Comments

I also was not able to observe that and solved a harder problem, used prefix sum and ordered multiset. 275621322

Let's do it.

coderdhanraj An editorial for both the rounds will be helpful.

I got TLE too doing the same thing.

Edit : it was not the same thing.

I think tourist's solution for problem D is simple and easy to understand. He did it in under a frickin minute.

On cf_judge → Cheating case, 3 years ago
+6

She may be an LGM from an alt account as she has submitted 3000+ rated problems.

Spoiler

Thanks for explaining.

Congratulations!!

Hoping to get there soon.

Thanks. I get it now.

I am getting tle in salary queries. my approach is using segment tree: saving the max and min at each nodes then calculating the answer similar to sum of a range. Please help me optimize this code.

My Code
On MikeMirzayanov → Please, read this, 3 years ago
0

My condolences to you. May her Soul rest in Peace.

But this test case anyways has no solution, provide a test case in which iterating from the smallest value give wrong answer.

"If we iterate from the smallest value to the top, there will be scenarios where all the remaining positions i will result in max(p[i],q[i])≥a[i] because you don't have enough smaller integers." This is written in the tutorial of problem C. Can anyone pls provide me a testcase where this scenario happens?

Thanks for the comment, for last half an hour I was also thinking of xor. At first i thought you did a typing mistake an replace xor with or lol.