Read before:
This blog should be just taken as a witness of my progressions as well as ideas to inspire readers and will inevitably feature bad-looking code styles or non-best solutions. Better solutions to problems mentioned in the blog are welcome in your readers' comments.
All codes in this blog can be compiled in Java.
Hello, Codeforces!
The Tsinghua University buddies have fought back against the failure of the based-on-Zhili-Cup Codeforces Round 1010 (Div. 2, Unrated), accompanied by a brand new rated Codeforces Round 1012 (Div. 2) which was held on Mar/23/2025 08:35 (Moscow time). Having taken the round as the only chance to establish an academic link with the top college in mainland China throughout my lifetime as a Chinese resident again, I struggled out of my noon break to take the meaningful challenge.
This blog is an editorial that will show my understanding of 3 problems of the 8 (or 6 if taking the 2 subtasks as 1) in the contest and the corresponding code blocks for solutions. I do hope that this can inspire you as readers.
2090A - Treasure Hunt
(The idea hit me in 1 minute after the problem reading is finished.)
2090B - Pushing Balls
(The idea hit me in 2 minutes after the problem reading is finished, but debugs and fixes took me additional 50 minutes.)
2090C - Dining Hall
(The idea failed to hit me during the contest and it was 1 day later when I was traveling on high-speed railway train that I got inspired by a solution.)
2090D - Simple Permutation / 2089A - Simple Permutation
(The idea failed to hit me during the contest but came up hours later.)
In a nutshell, the round is interesting and it helped me find out what I'm short of. The contest was followed by a codility test for job from a company, which might have made me distracted during the contest. Again, the solution may not be the best but I do hope this will inspire you as readers. Should there be better solutions or hints, please wait for official editorials for details.
Thanks in advance for your reading.
yo not bad,also thanks I have been waiting for editorial to solve D
For A, if you just take the remainder directly after dividing
a % (x+y)
, and then put a condition to check if the remainder is less than or greater than the value of x, it would give the same answer as we dont really need to find the cycles completed.For B, i took an hour cause i didn't wanted to make a grid and check if the matrix is possible in one parse of input using counts.
i had some problems implementing that so went back to same approach as you.
You are right. I was so dumb during the contest
i also fumbled with B's implementation when an easier way was possible and wasted an hour when i could have solved C and D lol