Can someone explain the approach to the solution of the problem http://codeforces.com/contest/295/problem/C. I've gone through the editorial but it isn't very explanatory.
Can someone explain the approach to the solution of the problem http://codeforces.com/contest/295/problem/C. I've gone through the editorial but it isn't very explanatory.
I tried to hack the solution http://codeforces.com/contest/548/submission/11295460 using the hack http://codeforces.com/contest/548/hacks/155602/test but it was unsuccesful .
I am unable to understand that despite being a O(n*m*q) solution, how the solution passed the hack but eventually got TLE on a system test?