Блог пользователя Leftist_G

Автор Leftist_G, 8 месяцев назад, По-английски

你好, Codeforces!

We (DBOI Team) are very glad to invite you to participate in Codeforces Round 1083 (Div. 2), starting at 26.02.2026 17:35 (Московское время).

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:

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.

  • Проголосовать: нравится
  • +377
  • Проголосовать: не нравится

»
8 месяцев назад, скрыть # |
← Rev. 4  
Проголосовать: нравится +20 Проголосовать: не нравится

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...

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +62 Проголосовать: не нравится

As a tester, fake_banana (a.k.a. wdnmdwrnmmp) will win IOI 2026!

»
8 месяцев назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +12 Проголосовать: не нравится

你好,Codeforces!

it is really unusual to see Chinese in codeforces announcement.

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +29 Проголосовать: не нравится

As a ?, good luck & have fun!

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +54 Проголосовать: не нравится

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

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

GLHF!!!

»
8 месяцев назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +4 Проголосовать: не нравится

This photo is really amazing cool_milo, StayAlone and Leftist_G

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

As the author's classmate, I believe this round will be quite wonderful. By the way, hope this round goes successfully!

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

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

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

大家好, as a french, I enjoy french fries a lot so I hope I'll enjoy your round too :)

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

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!

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

I did poorly in the previous educational round. I wish I can get my specialist back in this round.

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

French fries pig?

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

As a tester, I think the problems are insteresting! welcome to participate this round!

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Have a nice day,everyone ༼ つ ◕_◕ ༽つ

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

As a tester, I hope everyone can come and participate in this interesting competition. GL & HF!

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

"你好" Finally, some Chinese in codeforces!

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

你好

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

aa

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

They're very "handsome"

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Have to participate after seeing "你好, Codeforces!"

»
8 месяцев назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I love Dev 2 contests, even though my rating may decrease

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

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.

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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?

  • »
    »
    8 месяцев назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    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.

  • »
    »
    8 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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.

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Got stuck in problem D, but it was a nice contest! Can anyone give me some hint for D?

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Any hint on problem B??

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

C is so cursed!

»
8 месяцев назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +22 Проголосовать: не нравится

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 :)

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Is it just me or have the runtime limits on CF problems gotten stricter lately?

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Problem C was an arch-nemesis

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

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!

»
8 месяцев назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

E is very similar as GDKOI2025 day2 probG

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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.

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

I enjoy solving E, F very much, thanks for the round!

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

i really enjoyed todays div2 contest. first time solved a and b fast

»
8 месяцев назад, скрыть # |
← Rev. 3  
Проголосовать: нравится +14 Проголосовать: не нравится

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

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +32 Проголосовать: не нравится

Problem E’s test cases are weak, so my fake $$$O(N^3)$$$ solution passes the system tests.

364520080

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

G is pretty cool, thanks

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

My submission of E only ran pretest. What’s wrong with it?

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

what mean DBOI team?

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Chinese people are just so good at coding that's unbelievable.

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

I really think C is not that good , it doesnt look like a good position to put C

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

My title finally drop back to green. Still stuck on C without any ideas...

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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.

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

364530384

i don know why my submission skiped.

  • »
    »
    8 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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.

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

in 3 attempts I became a specialist

»
8 месяцев назад, скрыть # |
← Rev. 2  
Проголосовать: нравится -10 Проголосовать: не нравится

became a specialist in 4 days

image

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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?

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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?

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How G?

»
8 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Well, I will announce the answer. In the picture, the right is StayAlone, the middle is cool_milo, and the left is me.

»
7 месяцев назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

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?