你好, Codeforces!

We (DBOI Team) are very glad to invite you to participate in Codeforces Round 1083 (Div. 2), starting at Feb/26/2026 17:35 (Moscow time).
There will be 7 problems for you to solve in 2 hours and 30 minutes. All problems were authored and prepared by cool_milo, StayAlone and me. This round will be rated for all participants with rating below 2100.
I would like to thank the following list of very strong individuals for making this round possible:
- Error_Yuan for the excellent coordination and for making problems better.
- Alexdat2000 for Russian translation.
- CTHOOH, LiHn, Angelic717, StayAlone and me for providing some rejected problems.
- All the testers for testing and sharing feedback: qingbaiqwq, fake_banana, _istil, wangzirui123, __baozii__, liuhangxin, 10circle, Leasier, ZilT, zhy1206, MikaMisono, Murinho, madlogic, wuhudsm, 0htoAi, yanghanyv, y_kx_b, lllsssccc, Comentropy and Muhammad-Daniyal.
- MikeMirzayanov and KAN for incredible Codeforces and Polygon systems.
- You for participating the round.
- Lastly, the main character of the problems — Simons, a young and swag music producer and rapper who likes French fries, in a parallel universe. ⭐⭐⭐
Picture of authors (and there are also some testers off-screen who are shy to show their faces):

(Guess which handle belongs to each author!)
Score distribution: $$$500 - 750 - 1250 - 1750 - 2500 - 2750 - 3250$$$.
Good Luck & Have Fun!
UPD: Editorial is out.








Good luck on Div 2!! Special support to Leftist_G, StayAlone, and cool_milo! Show some high performance today, guys. May the force of competitive programming be with you! But unfortunately i cant participate in round...
+
+
As a tester, fake_banana (a.k.a. wdnmdwrnmmp) will win IOI 2026!
你好,Codeforces!
it is really unusual to see Chinese in codeforces announcement.
As a ?, good luck & have fun!
Hello, codeforces! I am cool_milo, as we diligently prepared the problem for months, the quality of the round is definitely qualified. Hope you positive rating delta & have fun! :P
As an author, cool_milo is actually cute_milo qwq
agree qwq
GLHF!!!
This photo is really amazing cool_milo, StayAlone and Leftist_G
As the author's classmate, I believe this round will be quite wonderful. By the way, hope this round goes successfully!
Congratulations on the preparation of the round! I organized local competitions for my classmates, in the CodeForces format, and I understand that it is difficult to organize a competition even for a small group. I'm still a beginner and I solve A and B consistently, but every round I set myself the task of solving C. Tomorrow at 17:35 Moscow time I will be at your round and I will try to solve as many problems as possible
Also, this round may be the one when I become a 1200 Pupil.
Bad luck
Yes, I was unlucky in this round, but now I have 1200 Pupils.
Congrats!!!!
Thank you!
大家好, as a french, I enjoy french fries a lot so I hope I'll enjoy your round too :)
A 7-problem Div 2 with French fries and rap lore is exactly what we needed to end the week. Huge thanks to cool_milo, StayAlone, and the massive team of testers for the effort! (I'm guessing the one on the left in the photo is cool_milo). Good luck and high rating to everyone!
Actually, the one in the middle is cool_milo.
Oh my bad!
I did poorly in the previous educational round. I wish I can get my specialist back in this round.
French fries pig?
As a tester, I think the problems are insteresting! welcome to participate this round!
Have a nice day,everyone ༼ つ ◕_◕ ༽つ
As a tester, I hope everyone can come and participate in this interesting competition. GL & HF!
"你好" Finally, some Chinese in codeforces!
你好
aa
They're very "handsome"
Have to participate after seeing "你好, Codeforces!"
I love Dev 2 contests, even though my rating may decrease
Solution of E: For any subarray B of A, assume we need to flip it. If there exist a pair of array S, T (T could be empty but S could not) such that B = S + T + S, then rev(B) = rev(S) + rev(T) + rev(S), so we can flip S, T, S instead of B. For any division of A, if no subarray fliped has property mentioned above, it will be the only division with the largest number of subarrays among all divisions with same result after flipping. So we can solve by dp: let dp[i] = the number of valid division of A[1...i], the transition will be dp[j] = sum(j<i, A[(j+1)...i] cannot be represented with STS form)(dp[j]), where the condition could be checked using KMP algorithm.
Solution of F: A graph with only nodes of even degree can be split into some cycles, look at "cells" surrounded by these cycles. If we add a path with positive sign and a path with negitive sign on every edges "inside" these cycles (which doesn't change the sum of paths), we can split all paths into some cells with four edges surrounded, with positive sign on the edges above and left, negative sign on the edges right and below. So we can represent the problem as "choose some cells with the largest sum of contribution, where the contribution of each cell is the weight of edges above and left, minus the weight edges right and below". For any invalid edge, the two cells adjacent to it must be both chosen or both not chosen, so we need to add a link between adjacent cells of any invalid edge (if any of them is outside the grid, mark another cell as invalid), then for every connected component formed by links, we only need to choose these with positive total contribution and without invalid cell.
In E, how can we prove that $$$ans_i = \sum{ans_j}$$$ for all $$$j \lt i$$$ such that $$$a_{[i:j]}$$$ isn't (1) a palindrome or (2) has a common prefix / suffix?
I initially had a way more complicated condition instead of (2) before realizing it didn't pass samples and just observing that using (2) instead made it match the test case's answer. I can intuitively see why it might prevent over-counting, but how to prove it?
We denote the reverse by $$$r$$$. I would call the array a string sometimes. I denote $$$a_ja_{j+1}...a_i=a_{[j:i]}$$$.
If $$$a_{[j:i]}$$$ is a palindrome then flipping it won't do anything (string stays the same).
If $$$a_{[j:k]}=a_{[i-k+j:i]}$$$ then $$$r(a_{[j:i]})=r(a_{[i-k+j:i]})+r(a_{[k+1:i-k+j-1]})+r(a_{[j:k]})=(r(a_{[j:k]})+r(a_{[k+1:i-k+j-1]}))+r(a_{[i-k+j:i]})$$$. Note the $$$r(a_{[i-k+j:i]})$$$ in the last expression is a shorter suffix and hence we must not double count here.
For any other case, reversing $$$a_{[j:i]}$$$ would make $$$r(a_{[j:i]})$$$ a unique suffix that was never seen before.
Therefore we only add $$$ans_j$$$ for the "any other case" part.
Instead of Finding how many S can be transformed into T, We can calculate how many distinct S we can get by reversing the subarrays of S. (why? If T can be obtained from S then S can also be obtained from T by re-applying all the operations)
Now, dp[i] = how many distinct arrays can be get from A[i ... n]
dp[i] = sum(dp[j]) {considering we will reverse A[i .. j-1] and concatenate all the distinct arrays we can get from A[j .. n]
Now , if A[i .. j — 1] is not a proper prefix then then there exists a k such that A[i .. k] == A[j-k-1 .. j-1] then reverse(i ..k) + reverse(k+1 .. j-k-2) + reverse(j-k-1, j-1) == reverse(i..j-1) thus this is already counted when we made a transition from dp[i] to dp[k-1]
Thus to count unique arrays we can only transition to j's such that A[i ... j-1] is a proper prefix.
Got stuck in problem D, but it was a nice contest! Can anyone give me some hint for D?
Hint: The valid final array if plotted will always be in "V" shape. Now maximize the length of each "leg" of the "V"
oh cool, let me see here.
I think this doesn't work in this case
we can make
12 9 5 3 8 11 15which isV-shapedand has size7. but the answer is not8 (15-7).. it is9... this is last test case in the questionAh, you're right, I'm oversimplify my explanation too much and missed one more rule: if you plot both the "V" and the full array, the "V" plot should be always above or equal to the full array plot.
Here is in your given case, there are part of the "V" that is lower than the full array plot:
oh ok, thanks for sharing the drawing.
Any hint on problem B??
Try to think about the divisors of a number N and how this can help you to find the answer
u have to get all the unique prime factors and multiply them to get the answer
Prime factorize n and think for each factors when dividing k^n.
Try to prove this :
Let
be the prime factorization of a positive integer $$$x \ge 2$$$, where
$$$p_1, p_2, \dots, p_n$$$ are distinct primes and
$$$e_1, e_2, \dots, e_n$$$ are positive integers.
Prove that
C is so cursed!
Am I the only one who feels C >> D in terms of difficulty?
At least for me C required some thinking even after identifying "solve in reverse" to figure out how to correctly obtain the lexicographically minimum with different sized arrays.
Meanwhile D just boiled down to "A cool array is a trough", "The operation can only delete smaller elements so each side is a sequence of next largest elements", "Stack go brrr"
Not that I think C > D in terms of quality, I probably still like problem D more :)
Yup, problem C felt way tougher. D was way easier.
i get the idea of reverse each array then sort it
take the smallest array then removing the element from previous smallest array again sort array this time and repeat but not able to implement it :/
Yeah, also the implementation of C felt quite tedious (atleast for me).
This. I thought it was a simple problem but didn't like the implementation. I spend some time trying to come up with a nicer way to solve it, but got nothing better.
Wait, so you don't have to use lazy propagation on D?! I MIGHT have overkilled it.
C: More coding focused (storing sequence, removing duplicate, comparing sequence, removing sequence, a bit complex data structure, prone to indexing bug (me finally AC after 3 tries because if indexing bug o_o))
D: More thinking focused (easy to code the formula :D)
Use almost 30 mins to think about a greedy for C, but used only ~3 mins to realize that D is a dp on cartesian tree. C>>D imo.
Is it just me or have the runtime limits on CF problems gotten stricter lately?
Problem C was an arch-nemesis
Great problems! So are the songs. I was listening to the song 'Take It Away' during most of the contest duration. Thanks for the round!
E is very similar as GDKOI2025 day2 probG
Simon destroyed me lol.
I was already destroyed after 2 W.A on C but then my stupid brain misunderstood E and left D to solve E.
I enjoy solving E, F very much, thanks for the round!
i really enjoyed todays div2 contest. first time solved a and b fast
The problem E is similar to GDKOI2025 Day2 G.
Problem E can be reduced to this problem by selecting intervals of length 1.
I think this is just a coincidence, not intentional.
The original problem is in Chinese,you may use a translation tool to read it.
Related discussion: https://www.luogu.com.cn/discuss/1254294
Problem E’s test cases are weak, so my fake $$$O(N^3)$$$ solution passes the system tests.
364520080
G is pretty cool, thanks
My submission of E only ran pretest. What’s wrong with it?
Fixed. Thanks anyway.
what mean DBOI team?
Chinese people are just so good at coding that's unbelievable.
I really think C is not that good , it doesnt look like a good position to put C
My title finally drop back to green. Still stuck on C without any ideas...
Nice contest, had fun. For the D problem, I tried the following, however it gave TLE in test case 15-16ish : Mainly keep track of l,r, find the largest in this interval, now this needs to be sent to the very ending, hence deletion according to that gave me $$$min(ans(a,l,pm)+r-pm-1,ans(a,pm+1,r)+pm-l)$$$. I thought like quick sort it will have O(nlogn) average time complexity, however that didnt work... tried few early stopping condition, but still it wasnt good enough.
The divide and conquer solution for D also works.
But I haven't figured it out how ? Like how can I be sure that it wouldn't TLE on some specific testcase ??
O(nlogn) is achievable only with middle cut on range. Here it's not guaranteed that maximum always happens to be in the middle. A counter case would be a strictly increasing sequence which leads to quadratic time.
How so can you say a test case? A strictly increasing seq will take O(n) only
You are right but you can reverse every adjacent pairs in increasing sequence,
2 1 4 3 6 5 ...
This should easily TLE author's code.
364530384
i don know why my submission skiped.
It was skipped because it was identical to the previous submission.
The CodeForces judge doesn't retry submissions that are identical to earlier submissions because usually the verdict will be the same. In this case, you changed the compiler setting to fix a compiler error, so it would have made sense to retry it, but apparently the CodeForces judge isn't smart enough to realize this.
You can usually force recompilation by making some small changes to the source code when that happens.
Oh thank you for kind explanation!
in 3 attempts I became a specialist
Cool!
Thank you!
Bro did 10 completely different submissions for same problem with different coding styles in 2 different languages, lol. (in 25 minutes) https://mirror.codeforces.com/contest/2202/submission/364036353 https://mirror.codeforces.com/contest/2202/submission/364048864 https://mirror.codeforces.com/contest/2202/submission/364049363 (+ 7 more) Please ban him. And AbdGraph has same problem : https://mirror.codeforces.com/contest/2202/submission/364057344 https://mirror.codeforces.com/contest/2202/submission/364057589 https://mirror.codeforces.com/contest/2202/submission/364057833
I am not friend AbdGraph
became a specialist in 4 days
YES!!
A new star has borned...
what!
So, how exactly should Problem D be solved? I can only reason that the final answer is either monotonically increasing/decreasing, or shaped like a "V". How should I approach the next step? Can you give me some hints?
I think middle one is StayAlone, left one is Leftist_G, and right one is cool_milo.
Because:
The right one has glasses both on Codeforces and in real life.
The left one is a little chubby, like the cat in the avatar.
So only one account is left for the middle one.
Am i right?
How G?
Well, I will announce the answer. In the picture, the right is StayAlone, the middle is cool_milo, and the left is me.
Ok, but i thought that the right one has a glasses, so in Codeforces he will select someone with glasses.
Not only is Ginge a known cheater that did well on this round, he was able to gain rating on this round as a Master.
Presumably what happened is that he had already registered for the next div2 before the rating update happened. Should this be allowed? Is there any precedent on this?
before just saying i am a cheater please give some proofs
i train on usaco and its just time i will maintain my rating im usaco plat and trying to make my codeforces similar to it
You are clearly cheating, your 3 contests are already skipped and transition from rank 375 to rank 3 in just 5 days by some 2200 person is clearly impossible.