Comments

I'm fairly certain most of the feedback isn't for the problems' difficulty, but rather the lengthy statements as well as overall weird designs. And personally I found B and E to be horrible for different reasons. B has a very long and confusing statement for an ultimately simple problem, and is too trivial. It is almost just a "please implement this procedure" kinda problem. E is just implementation hell and not interesting at all. You get the idea in like 5 minutes and you have to deal with implementing that bs. I legitimately just quit coding it halfway cuz it was so boring and didn't feel worth it at all. But C and D were good though, I liked them.

What an absolutely legendary reference... maybe if Techno had done Codeforces, he would have had a pink handle somehow

Div2B and Div2C are cool problems. Though admittedly I kinda hate 2C cuz I needed to use too many braincells and so none was left to do D haha

Question

Not sure what you dont understand from the editorial, but maybe you need a more clarifying answer, so here it is.

All arrows appears twice, except for one. The arrow that appears only once is located in the C2 cell, so C2 is the answer.

On HoH0Ho → Disappointed in myself, 8 months ago
0

You may treat it as a hobby that you enjoy. If you have fun while doing it, even when you can't do it well, then you will stop caring about you're skill level and just solve problems for the sake of solving them.

Besides, in my opinion, some people who are passionate about something and really enjoy them tend to get better without as much effort as it would take for them in an activity they don't enjoy.

Well that is just implementation detail. Basically the operation can be rewritten to "choose i and j and move any amount from arr[i] to arr[j]" and k is amount of operations we've done to get all arr[i] so far to become mx (or mn in the case of checkmn), but haven't picked the index j to move it to. So every time we meet an element that already satisfy mx or mn we treat it as arr[j] and want to deduct as much from k as we can.

Well based on the fact many skipped D to solve E, probably many people will agree with you. But yeah it is definitely quite straightforward, even compared to some Div 2 D in the past.

+9

That is O(NlogN). gcd's prime factorization will consist of at most logN numbers and each time finding the next minimum gcd will remove at least one of those numbers. Your code will loop through array at most logN times until gcd becomes 1 and it will stop. Thus it's N logN

That aside, the point of the comment you're replying to is to describe a method that we can use precisely to avoid this approach if we can't prove it.

Just now I solved D by guessing, but I couldn't prove my solution. Can someone tell me why the following approach works?

Find the highest possible min using the operations, find the lowest possible max using the operations, then the answer is just lowest_max - highest_min.

Intuitively, it makes sense to me the fact that when using the operations to maximize highest_min you don't violate the operations used to minimize lowest_max, but I can't definitively prove it. Link to my submission.

"Otherwise, infinite tourists can also work together to create atomic bombs, each country will have their own."

Why is this so hilarious hahahah

Python has a recursion limit, it cannot handle deep recursion. Your dfs function probably got called over 1000 times deep, which made it RTE. You can set it by using sys.setrecursionlimit() but it is still capped and you shouldn't rely on it. For workarounds, see https://codeforces.me/blog/entry/80158.

+5

Actually fun fact. This is very similar to the most recent Div 2C, which has a quite similar use of the GCD concept. I immediately thought of using GCD because of how recent that problem was.

+4

Not quite. Compute gcd, let it be G. Then you can always make the array to be of the form 0, G, 2G, 3G ... (n - 1)G. Then finding the kth MEX is O(N).

0

FOR REAL I had submitted two C solutions which got Wrong Answer at test 5. At that point just gave up and used my beloved Python.

+1

Leetcode problems are very different from Codeforces problems. I assume you are decent at Leetcode problems because you started out with easy ones, then a bit harder, etc. For Codeforces, you can start with Div 4 problems if you are still struggling, then to Div 3, etc. You can use something like CFtracker to find problems of your difficulty.

0

Problem A felt like there was something to it, but the more I thought about it the realization came in: "Ahh.. it's just a trivial problem that was deliberately given a weird statement to confuse AI, isn't it?". It made me kinda dislike the problem, sorry.

On cry → Codeforces Round 965 (Div. 2), 2 years ago
0

Oh wow, yeah... this Div2 is so broken, some past few contests I solved A. B, C too slowly and couldn't get D, my final placement for those contests is lower than this one where I only solved A and B lmao. Codeforces contests can be really random sometimes...

On cry → Codeforces Round 965 (Div. 2), 2 years ago
0

I was ready to solve C before the 1 hour mark, maybe even solve D and get back to expert. Let's just say I was too naive hahaha

Oh nice. This is a more intuitive proof I think, thanks for sharing.

Oh yes I fell into that trap :( I spent a good 15-20 minutes trying to optimize iteration using bit mask meanwhile the O(n) solution is not that difficult to realize at all...