Hi,
I’ve started a blog where I write posts regularly on topics which are difficult to understand and have limited resources online. You may follow the blog here . All topics are discussed with problems from spoj, codechef and codeforces. Currently, it has posts on topics like ‘Inclusion-Exclusion principle’ , ‘Square-Root decompostion’, ‘Sieves’ etc. Please feel free to share/comment/ contribute. Any suggestion/constructive criticism is appreciated!.
Edit : Added new post to help readers get started with problem solving using segment trees.
It contains everything, even more, that what is required in competitive programming. Illustrations and examples are also available with each part along with optimisations, if required.
Also, C++ supports some inbuilt functions for the same:
__builtin _popcount(x), __builtin _popcountll(x) : Find the number of bits set in x.
__builtin _clz(x) : find the index of first bit set from left size, (Thus “31 - __builtin _clz(x)” can be used to find the value of floor(log2(x)) in a more efficient method)
You have recently put up a code that is being used in the on-going Sept Long Challenge. You should have waited for the contest to end before uploading that.