Hard version of this problem. Solve for N <= 2500 and K <= 2500.

Active In

International Olympiad in Informatics

Featured Contributions

reply in this discussion

Hard version of this problem. Solve for N <= 2500 and K <= 2500.

Read more… (14 words)

reply in this discussion

Code for the full solution, if anybody is interested

Read more… (10 words)

reply in this discussion

T <= 1000000. The TL was sufficient to allow both N^2 and N^2 log N to give full points.

For around 50 points, N was around 500. This was for an N^3 solution using the 2-pointer technique.

Read more… (37 words)