Comments

Yes, my bad! you are right :)

Thanks...my bad, I was submitting the wrong code!!!

I have tried both %lld and %I64d, none of them works :(

it is really surprising, i replaced min/max by fastMin/fastMax and it got accepted!!! (time taken = 2.9s)

+8

How to compute P?

On ReiCodeforces Round #188 (analysis), 13 years ago
0

Can someone please explain how to compute q(s) efficiently? Is it possible to compute within 1s (Total number of states is 10^9) ?