I recorded my participation in CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!), after which I explained the solutions of problems 1896A - Пиковые обмены, 1896B - AB-обмен, 1896C - Сопоставление массивов, 1896D - Единицы и двойки and 1896F - Инвертирование скобок. The link to the video is https://youtu.be/xNYdRfbuBQ8, but the video is still processing and will be ready for watching in several minutes.
I guess some of you, who will watch this video, have solved problem C. Could you please share your observations which led to the solution? I believe that the fact presented in the editorial is really unobvious, although I didn't have the worst intuition possible in this problem's plot. Instead I came up with a solution which took a (code)ton of time and featured an intricate way of applying std::set
with upper_bound
and discrete continuity. Not bad for making the editorial educational, but really inappropriate for succeeding in the actual contest.