-
Recent Comments
Sherry on Isn’t that pretty? kra on GRE countdown yazhini on Non-entities #1 suren on Non-entities #1 yazhini on A bookish movie -
Recent Posts
Archives
Tags
-
Hits
- 5,424 hits
-

My blog is worth $5,645.40.
How much is your blog worth?
Monthly Archives: November 2007
My brother is studying in tenth standard.
I: Do you know factorial?
He: (vigorously nodding his head) one into two into three into four into five into six into seven into eight into nine into ten into eleven into twelve into…
I: (irritated) I was going to ask you four factorial.
He: byeeeeeeeee five into six into…
I’m suddenly interested in blogging a little more actively. Let’s see how long this interest lasts. On a personal note, god save me if my life is gonna be a series of disjoint passions.
I knew of the implementation of considering all the subsets of a set using bitmasks – suppose that the superset contains n elements. The number of its subsets is N=2^n.
for(i=0; i<N; i++)
for(j=0; j<n; j++) if((i>j)&1) { jth bit of i is set; consider it as “jth element of n elements is chosen” and do things; }
Tautology in SPOJ is solvable using just this, if you knew how to evaluate a prefix expression.
What I wanted to mention, however, is that the function __builtin_popcount(unsigned int x) returns the number of bits set in x. It is a built-in function in GCC. Another thing I came across today and wasn’t aware of till now -
__FILE__ is a macro for the filename of the program,
__LINE__ for the current line number,
__DATE__ for the date as a string,
__TIME__ for the current time as a string.
