Hello Codeforces,
After decades of hard work and several quality reviews from independent third parties, I'm delighted to invite you to participate in Codeforces Round 1073 (Div. 1), and, if you really want to, Codeforces Round 1073 (Div. 2), which will both held on Jan/17/2026 17:35 (Moscow time).
In each division, you will be given $$$7$$$ problems and $$$3$$$ hours to solve them, one of which will be divided into subtasks. Problems were mainly authored by me, nifeshe, with help from nika-skybytska and satyam343. Only $$$6$$$ or $$$7$$$ problems will not be interactive in each division, so please make sure to read the guide for interactive problems before the contest.
In related news, we’ve already been awarded the Nobel Peace Prize for this round, for achieving a level of problem quality so universally accepted that all global conflicts have been resolved.
I would like to thank the following people for making the contest possible:
- satyam343 for outstanding coordination and helping with problem ideas/preparation.
- Um_nik for preliminary reviewing the round.
- Sana for being the most helpful tester I've ever seen.
- EvenImage, Geothermal, A_G, sammyuri, _istil, Intellegent, catgirl, Dragos, weirdflexbutok, Hori, samsoom, whiitex for VIP testing.
- The rest of our testers: LipArcanjo, Adam_GS, __baozii__, jiazhichen844, maomao90, IceKnight1093, wangmarui, caterpillow, -firefly-, arvindr9, djm03178, omsincoconut, CatsAreCool, reirugan, conjectureguy, SpyrosAliv, chromate00, Non-origination, beaten_by_ai.
- Alexdat2000 for translating the problems to Russian.
- MikeMirzayanov and KAN for the Codeforces and Polygon platforms.
- And You for participating!
The score distribution is below.
Div. 1:
| A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|
| $$$500$$$ | $$$(750 + 750)$$$ | $$$1750$$$ | $$$2250$$$ | $$$2750$$$ | $$$3500$$$ | $$$3750$$$ |
Div. 2:
| A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|
| $$$500$$$ | $$$1000$$$ | $$$1250$$$ | $$$(1500 + 1250)$$$ | $$$2750$$$ | $$$3250$$$ | $$$3750$$$ |
Unlike other rounds, this one will only be held once, so I sincerely hope you will not skip the round and enjoy all of the problems.
UPD 1 The hacks are disabled for problems A — D2 in Div 2, and for problems A — B2 in Div 1. We have final tests consisting of pretests and hacks for all problems.
UPD 2 Editorial
UPD 3
Congratulations to the winners.
Div. 1:
Div. 2 (subject to change):
First solves:
Div. 1:
A. 00:02:15 by TKT_YI
B1. 00:08:23 by Petr
B2. 00:14:54 by strapple
C. 00:35:39 by jiangly
D. 00:21:27 by PCTprobability
E. 01:42:55 by XVIII
F. 02:53:16 by olmrgcsi
G. 01:34:40 by rainboy
Div. 2 (subject to change):
A. 00:01:21 by akshW
B. 00:05:49 by khushicodes03
C. 00:10:28 by ansh91627
D1. 00:12:47 by CoderMeow
D2. 00:18:11 by sks4401
E. 00:54:52 by crimson_leaf
F. 00:47:03 by shobhitgagrani.coding33
G. 02:54:37 by dooglius








As all of you probably know, this round, being the best Div. 1 round in the history of Codeforces, and also the best Div. 2 round in the history of Codeforces, is held exactly one year after the former best Div. 2 round, Codeforces Round 997 (Div. 2)!
As a tester, an even better Div. 1 round will be held in two weeks.
🤥
2 contest-testing streak!
Therefore, I will not participate in this round, but instead choose to participate in the LeetCode bi-weekly contest.
Disclaimer: these views are his own.
As not a good Div.1 round setter, I seem to have tested all the Div.1s in January 😥.
As a tester, I can confirm that nifeshe stopped playing bedwars to set this round
as nifeshe's former teammate, I am beyond dissatisfied with this betrayal and I demand nifeshe's return to bedwars immediately.
As a tester I showed the problems to all the world leaders and the problem quality was so high they mutually decided that it is now illegal to not participate in this round.
so i can legally skip this round, lets goo
As a VIP tester (idek what it exactly means), div was so good I stood up and applauded mid testing
Wish I can relate.
shoutout Salt,Jordan
its Karak first !!! salt second, AL Majali <3
as his majesty said "karak is karak whether you read it from left or right"
shout out to his majesty
India>>>>>>
Then its better to be a good DIV
SAMSOOM ALL THE WAY
Here we go again with 6-7 meme.
Did he just say 6-7??
oh... thanks :) i did not even notice! the meme is getting old
I'm back on Codeforces and hope to achieve good results.
History books in 2050: ‘GTA 6 delayed, but Codeforces secured the Nobel Peace Prize by giving 6–7 non-interactive problems in a single round.
sixxseven meme geting old
not the 67 joke :sob:
67 mentioned!!!!
Hope to reach my highest rating ever before.
as a VIP tester, I solved 1e9 versions of problem D lmao
Wow! Trump did CP?
In fact, he did!
In fact, his friend Epsilon was a problem setter also. They used to take contests on his Island!
What do you mean by "Nobel Peace Prize"?
You will be offered 6-7 problems and 3 hours to solve them.
I hope this 6 7 joke is sent to cry's basement.
Comment
You are too funny buddy
As someone who did not provide feedback during this round, I was not forced to leave a comment on this blog. nika-skybytska ORZ!
very nice this round
as a 940 rated cp-ist, how many questions do I need to solve (or, should be able to solve, i suppose), to not completely botch my current rating
depends on the contest but upto div 2B perhaps?
do div 3 and div 4 instead
just giving it a whirl, worst case i take a massive rating hit and never code again
okay i got absolutely destroyed but the one question i did manage to get didn't let my rating drop :)
The score distribution has not been released yet.
Is div 2 rated?
For people with rating $$$\le 1899$$$, yes.
World peace is just a O(1) solution away, unless Trump gets a Wrong Answer on Test 2.
Nobel Peace Prize ha ha
This one was good contest actually.
As a participant, Good luck everyone!
Excited after reading the first comment.
The difficulty level suddenly increased after D1.
least unbalanced div2
Yes, I will partially agree with that. The round will be considered a good Div1 but yes, the rating jump after D1 or even D2 for a Div2 contestant is too much.
GREAT CONTEST. I just have a small suggestion that considering Div1 B1 and B2 had different solutions (though, one could have extrapolated the suffix part to the harder version as well); B2 should have more points than B1.
I know that the problem B as a whole should have <= points than C but still, it could have been managed.
And B2 was a lot harder than B1 as well (at least in my opinion)
SIMPLY LOVELY
is it only me or anyone else during the whole contest felt that they can solve E in less time compared to D2 even though E has less no of accepted submissions?
Good problems. 1C is solvable in $$$2n+\log(n)$$$ operations but $$$3n$$$ has easier implementation.
I think it's 2n+2*(log(n)-1) because you should binary search twice. Isn't it?
Yes. Thanks for pointing it out.
Not necessarily, 1 binary search can be enough. In my solution (358364932) you can replace lines 96-99 with single binary search and get $$$2n + \log(n) \pm O(1)$$$ operations.
Wow, I'm shocked I was the only div2 to solve div2G! I guess skipping E/F helped
$$$D2$$$ is too hard for us Div2 peasants :(
Good problemset though, thanks for the round nifeshe and all testers.
D2 is the one only one problem where you don't need to think
How so?
It's a direct DP problem (assuming you got D1) but I found it hard to implement (well I think there is an easier implementation that I dismissed thinking the time complexity was not good enough when in fact it was)
I did solve D1, and I did think of DP for D2, but couldn't come up with the states. Could you tell me your approach for it?
The approach that I initially thought of was to find the total number of RBS subsequences of a particular length in the string by using 3d DP. Like define dp[i][diff][len] as the number of subsequences of s[1...i] of length len where count['('] — count[')'] = diff (and also that there are never more ')' than '(') so you would basically get dp[i][diff][len] = dp[i-1][diff][len] + dp[i-1][diff-1][len-1] is s[i] is an open bracket and dp[i][diff][len] = dp[i-1][diff][len] + dp[i-1][diff+1][len-1] is s[i] is a closed bracket. I did some mistake in the analysis and thought this was an O(n^4) algorithm I'm pretty sure this is O(n^3))
Now the RBS subsequences where the score is 0 are of a particular form. If the length of the subsequence is 2*p then the first p-1 positions have to be open brackets. So the number of possibilities of such "bad subsequences" is low enough for you to find all the bad sequences manually and then count how many times each of the subsequences come in s.
For each length you can find the number of "good" subsequences and multiply it with length-2
this is the 3rd div1 contest in a row where problem F (D in this case) involves calculating combinations on trees
It was a good contest for me . C and D1 statements were vivid and that took really a lot of time but it was amazing i felt . A big thanks . Could have got a plus 100+ delta but typo and c d costed me a heck of a time . But I really enjoyed the contest.Again, Thanks a lot for rejuvenating my problem solving experience:)
Idk about you, but this is VERY sus:
crimson_leaf's solves for this round
Thank u so much authors. Tbh best div2 ever for me (although i have attended only 6 contests :D).
This div 2 round was comparatively easier.
Guys can anyone tell me how you solve E?
Is Div.1 D sth related to probability instead of naive calculation??
I just came up with that and it passes sample but I cannot submit!!!
I did this, however one of my "ifs" was missing a print of a space, now I'm waiting systest to submit again (passed)
Basically merge node i with n (or don't if already linked) Then I calculate all trees using the formula and multiply by the size of subtree of node i divided by the size of the merged tree (which means the probability of the component with node n-1 being attached to the subtree with node i)
Same idea. Now I got accepted and realized this observation is really intuitive and could be easily proved.
10 seconds is all I needed to submit problem C's solution, if only I didn't forget to write the count of Zeros and Ones in the output. This round was nice
i fucked up
Why can D1B2 be solved in $$$\mathcal O(n^2)$$$ but has $$$n\le 100$$$? Why can D1C be solved in $$$2n+\mathcal O(\log n)$$$ operations but has $$$3n$$$ limit?
No point in making implementation harder with no new ideas
div2 with out interactive problems!! the ultimate way to test ur ability to suffer silently
Who on earth thought Div-2 D1 would be this simple? It feels like Codeforces contests are getting more and more unbalanced day by day, especially Div2. Years ago, an average Div-2 C was solved by around 2k people; now Div-2 D1 gets solved by over 4k+, and the last EDU div-2 problem E is solved by 2k+ during contest time. This is getting ridiculous.
There are 8 problems in both divisions including subtasks so of course one would expect problems to be easier than usual for their positions?
You aren't wrong, but it was a 3hrs contest (more time -> more problems)! But yeah, valid point, since Div-1 and Div-2 were separate, the problems could be easier. I should've thought about it more precisely.
In Div2 C, the problem statement mentions a sequence, but in the sample test case example subsequence was mentioned which i missed reading during the whole contest and tried solving the problem assuming it was a sequence. I believe this ambiguity should have been clarified explicitly in the problem statement.
i wouldn't able to solve any problems except from a, I give my best i think so that truly matters, would analyze the problems. Thanks for the problems they game so much motivation to solve and attend other contest as well.
6 7? Come on, that’s way too specific to be an accident.
Div 2 E is fire
Div 1C and Div 1E are good problems, but I have mixed feelings about Div 1D 😭😭
I'd rather have that than calculating a million tiny things on subtrees.
1E is just boring :( I felt ABC are good problems, D is average, E is implementation heavy.
358297716
std::merge(a.begin(), a.end(), b.begin(), b.end(), c.begin(), query);
This line in jiangly's Div. 1 C code is incredibly elegant.-
I wonder when you say same for me :(
Thanks to the authors. Loved 2E/1C!
The Div.1 part of this round is so GOATED!!!!!! I love all the problems I've seen!
Also the division part of 1D is too clever for me to come up with so meowww here goes my rating
intresting contest!I like it.
I like this round a lot! I think the quality of problems are truly high, and great for me to practice.
I participated in division 1. However, I failed to solve problem C. Interactive problems are challenging for me. I need more practice.
A~B2 are quite easy, though B2 has a lot of details in dp. D needs a bit implementation and detailed analysis. C is a great problem, it is easy to solve in $$$n\log n$$$ queries, but needs more observations to solve in $$$3n$$$, which is really inspiring. I am still trying my best to learn E, which still seems reachable in my level but I didn't solve.
F and G are math problems, and they seem a bit hard to obtain for me.
Congrats on GM! :)
best of luck , you are also gonna be red very soon , mind if I ask where do you practice alongside Codeforces
Dear Organizers Ita a humble request that if in Alice/Bob questions, we need to worry about the cases and the checker is CASE SENSITIVE, then it should be highly emphasized. It took me an HOUR to solve C, not because of the logic, but because I didnt realize that I need to change "BOB" in one place to "Bob" for it to work. Such questions never had this condition of case sensitivity at all. And this change Really hindered my performance.
which ide do you use to validate sample test cases?
In general, these things are easily caught while validating sample test cases.
To explain better what happened, I'm posting my solution method solve()
This is the one which led to correct submission
And this led to incorrect submission
My code was designed such that in test case 1, it never prints "BOB" so thats why it passed test case 1 but not test case-2 despite the correct logic
You should always assume the checker is case sensitive and you should output exactly what you're told to output in the exact format you're told. You don't need to be reminded that water is wet either. It's when checker is case insensitive that it's emphasised, what you did was insert your own assumption and demand that it's accommodated when it turned out to be wrong.
Taken to logical extremes, your way produces statements with an insane amount of obvious things repeated ad nauseam.
Div 2 C could have a bit of better wording with the indices description :(
hoping to improve more next time!..thx for mention
There is a reason why it is mentioned : Subject to change.
No way you wrote this code 358306583 and not even locally tested it.
Nice trolling :))
if (!(cin >> n >> m)) return;
why do they use such lines in their code, lol.
Heartiest congratulations to the veteran Petr for securing rank 1 after such a long period of time.
Cry’s basement officially unlocked: all spikes jumped over successfully! Geometry Dash vibes
Hello, I got a plagiarism warning for my submission of 2191C. I want to clarify that I solved it independently. The approach is very common (count zeros + misplaced indices), so similarities may be coincidental. I did not copy from anyone.
Please review my case. Thank you.
Hello Codeforces Team,
I am writing to sincerely apologize for the coincidence flag on problem 2191C (Submission 358345061). I want to honestly admit that the solutions coincided because I was using two different accounts, both of which belong to me. The handles are this one and H_Mobin.
I did not realize that maintaining multiple accounts or submitting the same code across them was a violation of the rules. I now understand that this is wrong and undermines the platform's fairness. I have already stopped using the second account (H_Mobin) and will only use this main account moving forward.
I am very sorry for the mistake and the trouble caused. I hope you will consider my long history on the platform and allow me to continue competing fairly. Thank you.
Hello, I received a coincidence warning for my submission 358365826 on problem 2191C. I want to clarify that I solved this problem myself and did not copy code from any other participant. Since the solution is very short and the approach is quite straightforward, I understand that many independent submissions may end up looking similar. I respectfully request you to please review my case. Thank you.
Hi, I want to clarify that I solved problem 2191C completely by myself. I did not copy from anyone and I did not use any shared or public source.
I also have my handwritten notebook solution and rough work for this problem, which clearly shows my own thinking process before submitting the code. The similarity is unintentional and just a coincidence.
If needed, I can provide my notebook proof.
Thank you for your understanding.