Hello, Codeforces!
cry and I are very very very excited to invite you to participate in Codeforces Round 1020 (Div. 3), which will take place on Apr/24/2025 17:35 (Moscow time). You will be given 7 problems and 2 hours & 15 minutes to solve them. There will be at least one interactive problem, so please make sure to read this guide if you are not familiar with the format. One of the problems will be split into two subtasks.
The round will be hosted by rules of educational rounds (extended ICPC). Thus, all solutions will be judged on preliminary tests during the round, and after the round, there will be a 12-hour phase of open hacks. After the open hack phase, all accepted solutions will be rejudged on successful hacks. Also, note that there is no score distribution but the usual penalty of 10 minutes for each wrong submission, following the rules of educational rounds.
Remind yourself that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:
- take part in at least five rated rounds (and solve at least one problem in each of them)
- not have a rating of 1900 or higher at any moment in time.
Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you (unless you register unrated).
Also, note the rule restricting the use of AI. If you are caught while breaking this rule, you will be terminated and haunted. So for your own safety, please do adhere to this rule.
This round would really not be possible without the help of the following people:
- cry for coordinating the round and being kind enough to offer a problem for the set and Vladosiya for statement translation;
- cowthecow and rangerscowboys for their initial contribution to the problemset with unused
and impossibleproblems; - the non finite amount of testers: Dominater069, Intellegent, -firefly-, Proof_by_QED, __baozii__, Edeeva, Timosh, Friedrich, reirugan, yoru_sacri, IceWolf898, rangerscowboys, rewhile, chromate00, RE_Prince, Furyna, Banis, pop, beaten_by_ai, pianapolataa, Ashrayy, cowthecow, macaquedev, larush, ETL, bricked_, sbreger60, Lapca5, and other people from cry's basement;
- MikeMirzayanov for the amazing Polygon & Codeforces platforms;
- You for participating.
I hope to see you in the contest, and that you will be an honest and fair participant.
UPD: Editorial
UPD2: Winners!
All participants:
Trusted & Rated participants:








As one of the non finite amount of testers, I wonder who all of the other testers are? I only see finitely many...
(how big is cry's basement?)
As a tester, I like cows :)
As a tester who proposed many rejected problems for the contest
because they were known/boring/impossible, I can confirm that problem set is original and very interesting.As a participant, hope to reach Expert!)
I hope to be on 1000+ rating.
good luck!
hi fellow cow species
master cow orz, the highest i knew before was CM
As a tester and an initial contributor of great
impossibleunused problems, you might have noticed SpyrosAliv's haunting threat, and you better believe him...Don't ask how I know(but I do)As a participant, I can confirm SpyrosAliv loves tree problems
As a tester, I'm wondering how big cry's basement is?
As a tester, SpyrosAliv's problems are quite delectable.
Excited for another Div. 3! Thanks to all the authors and testers.
hope to reach Specialist
this time i dont want to cry after the round. Hope to reach pupil!
As a tester, I am the most useless tester known to mankind.
Trivial
As a tester.. ugh I'm running out of things to write in "As a tester" comments.
Please marry me cry
Thanks Bombardino Crocodilo for bombing the homes of LLM cheaters and group solvers
npc
As a tester, I confirm I am the one from cry's Basement
As a tester, there is a nonnegative number of problems that can be found on other judges in this contest.
As a tester, I am real fan of Furina.
I too.
as a tester, i will find those who cheat.... and publicly shame them :)
As a participant I am disappointed that there is no mention of thanking the participants.
Almost all the div. 3 in 2025 gives me -delta. But I choose to comeback and participate anyway... (help)
Did you watch your lie in april again this year??
not necessary because it's already living rent-free in my head.
this is me but replace -delta with fst!!!!!!!!!
As a participant, I hope not to get hacked in this contest.
I hope std::map does not give TLE in this round
orz! hope i reach newbie after this contest
sir u are specialist???????? funny joke
just kidding
As a tester, I can confirm I'll cosplay around March 80th.
As a participant, STOP CHEATING for fuck's sake
I hope I will not reach pupil
so real
Hope to reach 1600+
I did it.
What is the point of interactive problems?
they are fun
Cry's competition: You can consider div4 as div3. You can consider div3 as div2.
As a tester, -firefly- tested (again).
A and B at least...
I hope this will be my first contest to solve all of it within time, hope no 2300+ today :)
As a participant, I hope to solve at least 5 problems
In last 2 div-3 rounds, my Handle changed from GREEN to CYAN. So, today I'm going to make this happen again tonight, inshaAllah...
May be not this time but hopefully next time...
To cheaters :
Please don't use AI. Pls.
As a participant, I hope I'll reach Expert
Bruh! Your Heatmap >>>>>>>>
(^_^)
Crazy stuff σɾȥ
Yay, i did it
I’m really excited for Codeforces Round 1020 (Div. 3), especially since the problem setters are experienced and well-known in the community. I’m sure the problems will be both challenging and fun to solve! Looking forward to participating and giving it my best shot
What does it take to AK this round ?
hmm this feels more doable than usually! good luck everyone!
It was one of the best contests I've ever done, first time to be among top 100 (placed 94th) ^_^
how to solve D?
when it would be impossible to make any operation?
we can do the operation of adding a new flower at most once, what does this relate for the previous hint?
let's try to pick the flowers greedily, when we find a flower that have a beauty more than the current needed beauty, take it
do this again but in reversed order
there will be two cases
before going to the cases, let's call the taken number of flowers on the normal order is $$$pref$$$ and the reversed order $$$suff$$$
we can see that:
if we have to add more than two flowers and there is no place such that adding a flower would give us a result, the answer will be -1
if we can add a flower, pick the length of the minimum flower between the flowers we can add (this can be done by checking the $$$pref$$$ and $$$suff$$$
here is my solution for the problem (check the hints before look at it):
[problem:E]This time, the questions seem much easier to understand and comprehend. However, there's an old saying: the simpler the question, the more complicated the matter. I feel like I'm stuck. Is there any expert who can explain E? I feel like a hungry wolf, eager to know the best solution for E. I have a hunch that there is one, but I just can't figure it out myself.
just simulate the binary search process, when the search is moving the l/r pointer to the wrong direction, you compulsorily move it to the right one, and count for these moments where you manually corrected the pointer. calculating the answer or determining if it's impossible would be trivial then.
The solve rates alone indicate how well balanced this problemset was with respect to difficulty levels. Thanks for the gradual progression and many interesting problems! ^_^
Stucked on D forever. Can someone explain it.
go forward and backwards to find longest sub-seq that fits the problem.
If sum of longest sub-sequence of both ends == k-1 then you minimize the answer along the way.
I bricked F, check out my spaghetti code mixed with bricks 317075083
Thanks for the good problem set, finally a good run div. 3.
I misread E which made it buffed , i want to suggest it and its approach anyways.
basically consider the rearrangements to be allowed in only $$$l$$$ and $$$r$$$ rather than $$$1$$$ to $$$n$$$ that way you will have to use a segment tree to obtain the amount of elements greater and less than $$$x$$$ in the given range, and then use same logic.
Time complexity : $$$n *(log{n})^2$$$
Space complexity : $$$n *log{n}$$$
I misread E too and did the same thing as you XD
As a participant, I hope to reach cry's basement
the best div 3 in a while. Loved it!!
release editorial i need to upsolve it now cry
Nice Round!
Nice problems. Yet again, my greatest pitfall, not reading the problem statements. I was sure problem G was about finding the root of the tree and not about finding the values haha. Although that does bring about an interesting question: how would one solve G2 if the problem was about finding the root of the tree? Like, in the case of G1, it's "pretty straightforward", but I couldn't figure out a clean idea for G2...
All solutions that I know of, including mine, involve finding the root of the tree then doing n queries to calculate the values
ok, that makes sense, I guess I just had to think it through a bit more
Thanks for problem F! It was a welcome change after the case-hungry problems before it.
"Why is my contest Unrated? I participated fully but did not see any rating changes."
It's rated. But it takes time for rating changes. Right now there's a hacking phase that'll end after 9 hours. Then the full test cases will be run. Then the rating changes. By tomorrow it should take effect.
could someone please explain why my rank is not the same in "common standings" and "friends standings" when not showing unofficial, but same when showing unofficial? Maybe the common standings exclude those who are't trusted participants while friends standings don't?
I have the same problem
it' even more weird that, I just check a previous div3 round and find that, the common standings, the frinds stanings, the rank on rating changes, and the rank on my profile are all different from each other. This is so weird.
Common standings = trusted participant + unoffical (equals to all participant excluded non-trusted participants)
Friend standings = all participant + friends filter
Rating changes rank = all participant. But might get affected by plagiarism checker after contest. Rating changes rank should be equal to friends standings + not showing unofficial AFTER the rating rollback.
thanks for solving my confusion, I understand now.
I only solved three problems. hope i will not minus...
D was a bit harder than usual (1400 from TLE bot), so I think you'll be fine
Turing bless
I love these authors. Best Div 3 of my life! I tried D, E, and F they were crazy. I didn’t get to the others, but I’ll definitely try them soon!
I think sir cry was prevented from making cute silly statements this round. I kinda missed them tho
All codes were uploaded during live contest by the popular Codeforces Youtube Cheater — https://www.youtube.com/@Code-Review-c91/community
His channel has 1000+ subscribers and for each Codeforces Contest — his live solution leak videos have 2000-3000 views on average. Contests are cooked for all — because no one cares to report such people on Youtube.
I expected codeforces to atleast flag the codes which are mostly similar to the popular youtube code leaker channels which most people know.
When I check the standings every second person has similar codes as this Youtube Channel Cheater — all they have done is — tell AI to make small changes so their code looks little different LOL
@SpyrosAliv
I am aware of the situation, thanks for pointing it out.
THE PRETESTS FOR C WERE SO WEAK FOR TLE
i dropped from 5k to over 10k
i knew my soln to C wasn't the most efficient but i submitted it and it passed so i didn't think much
pretests took 300ms, limit was 2s
this is so unfair, if the pretests were stronger i could've fixed the soln in like 5mins
It's not weak pretests, it's antihash hacks because you used set https://codeforces.me/blog/entry/101817 https://codeforces.me/blog/entry/62393
Hi I actually am not able to see any positive or negative rating change from this contest, although it was a rated participation. Is it possible some submissions are still under review and final rating for some participants has not been published yet, or have I been disqualified for some reason?
On your profile it shows as an unrated participation