Comments
+5

I disagree that all 4 requests are trivial. I’ll give an example with k=3. Lets say we have the following request L1=3, R1=6, L2=5, R2=12. We divide it into two requests on level k-1: L1=3, R1=6, L2=5, R2=7 and L1=3, R1=6, L2=1, R2=4. These two requests are not trivial. You would have to go at least one step further to prove that you are left with just trivial requests in some small, constant number of steps.

+5

I don’t think it’s that simple or perhaps I misunderstood something. You say that a single request on level p results in 4 requests on level p-1. This gives you exponential time complexity, not linear.

Anyone else thinks that Div1 B was a bit underrated? Once you have the correct idea and get all interval intersections right, you still have to take care of double counting some solutions, but only in cases where k=1.
On RipattiCodeforces Beta Round #81, 9 months ago
0
just in case ... scanf("%d%d%*[^.].%d",&a,&b,&c);
On RipattiCodeforces Beta Round #81, 9 months ago
0
How did you come up with 0.29? 0.58 works as well. I've tried some small numbers by hand but to my disappointment all of them got rounded up. I couldn't figure out how to run a search which would avoid arithemtics and compiler optimizations associated with them.
+4
FAQ really needs a link from main page. The amount of failed submissions because of %lld %I64d issue is huge.