Did I mention MO's algorithm anywhere? Anyway, the types of edges are based on whether they are deleted in the current sqrt batch or they arent.
Did I mention MO's algorithm anywhere? Anyway, the types of edges are based on whether they are deleted in the current sqrt batch or they arent.
You can precalculate inverse factorials.
Hi, how would you do it with DP?
How do you go about learning algorithms or data structures with scarce resources (or weakly translated resources)? I remember learning parallel binary search from a problem set by you, but there wasn't any resource easily available over the internet.
How most people get started?
By solving easy problems, to get a hang of the entire format and the language. For me solving topcoder div 2 250 problems was a great start. I could get them right most of the times with a score >= 220. Then I moved to div 2 500 and then to 1000 as I became better at solving problems.
Why most people do competitive programming?
For me, it seemed interesting when I started out. I wasn't doing really great (topcoder rating was as low as 462, codeforces was around 1300), but there was a sense of satisfaction with every correct answer. Also I have always been interested in mathematical puzzles, and programming contests gave me a way to pursue that interest.