On 300iqGood Bye 2021 -- Editorial, 2 years ago

Thank you!

141191656 — my submission with this approach. It's based on above conservation that not selected segment should have length 2 or 3.

But we also can build a segment tree and do not care about that notion.

On 300iqGood Bye 2021 -- Editorial, 2 years ago

Hello. I can't understand why my solution of D problem isn't working. I told that we can use some kind of greedy algorithm. Let's choose every number from prefix in our array. So if our prefix i isn't available(it's organize not possible situation), so we just don't mark this, in other case we just mark that number and go for i + 1. In that situation we know that for every possible combination of l and r < i problems statement is correct, so we should just check the case there i equal to r and compute the minimum avg_number for all possible l. If that minimum avg_number < x we don't mark x. I barely can understand why this isn't a solution for this problem. Can someone explain why this isn't working and probably give me not such a big sample of this? 141117167 — my submission. I understand that it's working with square n time, but problem with Wrong Answer and it's not very hard to organize nlog(n) time complexity.