YuukiS's blog

By YuukiS, 8 months ago, In English

Merry Christmas, Codeforces! 🎄 🎄 🎄

We are glad to invite you to take part in Good Bye 2025, which will start on Dec/27/2025 17:35 (Moscow time). You will be given 9 problems and 3 hours to solve them. At least one problem will be interactive, so please make sure to read the guide for interactive problems before the contest. This round is open and rated for everyone.

Problems are authored by conqueror_of_tourist, twosquares, and YuukiS.

We would like to thank:

Update 1: The score distribution is as follows

$$$500-750-1250-1750-2250-2750-3500-3750-4000$$$

⛄ We hope you'll enjoy the problems! ⛄

Update 2: Hacks will be disabled on problems A-E.

Update 3: Editorial

Update 4: Congratulations to the winners!

  1. jiangly
  2. Benq
  3. Kevin114514
  4. VivaciousAubergine
  5. ecnerwala
  6. StarSilk
  7. Radewoosh
  8. Ormlis
  9. ksun48
  10. BreakPlay

We sincerely hope you enjoyed a nonnegative number of problems on the round. We hope you have a Happy New Year (both on CF and irl... maybe go touch some grass for the first time this year)!

Announcement of Good Bye 2025
  • Vote: I like it
  • +1689
  • Vote: I do not like it

»
8 months ago, hide # |
 
Vote: I like it -120 Vote: I do not like it

1st

»
8 months ago, hide # |
 
Vote: I like it +72 Vote: I do not like it

I participated in the Hello 2025 contest, and now I’m going to participate in Good Bye 2025. Time passes so fast hoping to enjoy the last contest of the year. Merry Christmas, everyone!

»
8 months ago, hide # |
 
Vote: I like it +51 Vote: I do not like it

As a tester, I want to know why you're not playing Honkai: Star Rail.

»
8 months ago, hide # |
 
Vote: I like it +50 Vote: I do not like it

I am veryamazed by this contest.

»
8 months ago, hide # |
 
Vote: I like it +48 Vote: I do not like it

those who tested

»
8 months ago, hide # |
 
Vote: I like it +40 Vote: I do not like it

As a tester I can confirm that:

1: There are no ‘f’s in conqueror_of_tourist

2: twosquares is a subset of threesquares

3: I will steal YuukiS ’s profile picture for a week after me reaching red

4: One cannot heal with Auchenai01 Soulpriest on the board.

»
8 months ago, hide # |
 
Vote: I like it +42 Vote: I do not like it

As a tester, I would like to ask when the pizza is coming

»
8 months ago, hide # |
 
Vote: I like it +47 Vote: I do not like it

As a tester, I can confirm that:

  • All of the writers are from UIUC

  • UIUC is the best university

  • If you disagree, you will get negative delta from the round

»
8 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Wow, it's Frieren! Now I have to join in!

I hope to become a Candidate Master.

Wish everyone can get positive delta from the round!

»
8 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

My goat twosquares

»
8 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

As purple tester, I can confirm the contest is not purple.

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it +17 Vote: I do not like it

    as a purple tester, I can confirm that I am purple.

»
8 months ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

Gonna reach IM after this contest!

(Meanwhile checking my /settings/magic)

»
8 months ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

Tested

»
8 months ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

2025 end so fast

»
8 months ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

As a tester, I'm not occupied by Chemistry homework unlike last time.

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    I'm always your fan Mr Z!!

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Wherefore must we make haste to garner wisdom, for Time, that swift-footed traveler, doth leave us in his wake. The world’s dominion shall belong to those who, having sought a paradise of dreams and found it not, did straightway fashion it with their own hands.

»
8 months ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

orz YuukiS

»
8 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Frieren never disappoints

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How are the testers for gray/green/cyan/blue chosen, and what are their responsibilities? I'd like to help out sometime if it's possible but I'm entirely unaware of the system

»
8 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

I am reaching rating 1200

»
8 months ago, hide # |
 
Vote: I like it -12 Vote: I do not like it

I hope this one will be better than the 2023 goodbye

»
8 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

Time passes so fast .... finally year came to an end

»
8 months ago, hide # |
 
Vote: I like it -7 Vote: I do not like it

Merry Christmas!!!

»
8 months ago, hide # |
 
Vote: I like it -9 Vote: I do not like it

Merry Christmas everyone!

»
8 months ago, hide # |
 
Vote: I like it -24 Vote: I do not like it

Hellooooo Make mine id as Friend

»
8 months ago, hide # |
 
Vote: I like it -20 Vote: I do not like it

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

ummm.... idk if i'll enjoy problems or problems will enjoy me....

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

This is the last CF contest because the world is ending in 2026.

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

will the problems be sorted?

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it +30 Vote: I do not like it

    Yes, in the sense that we ordered the problems based on how hard we think the problems are. However, difficulty is subjective so it is not necessarily true that the problems will be sorted by how hard you find them.

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

This will be interesting and challenging.....

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

is it rated as div2 or div1?

»
8 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Hope to get a positive delta in this round!!

»
8 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

I took part in Hello 2025, and now I’m heading into Good Bye 2025. Time really flies. Hoping to enjoy the very last contest of the year and make it a good one. Merry Christmas, everyone

»
8 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

April 2025 — I wrote my first Codeforces submission. End of 2025 — I’m still here. Still solving. Still learning.****

»
8 months ago, hide # |
Rev. 3  
Vote: I like it +1 Vote: I do not like it

Solved 2 previous year , maybe will get +ve this year , happy new year everyone and hope you guys enjoy the eve well ^_^

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

One more great year passed with codeforces with so many contests and so much learning...

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

When you live for 1000+ years, you eventually become Santa. Is that you, Frieren?

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Wanna end this worst year with this good contest :)

HOPEFULLY!(

»
8 months ago, hide # |
 
Vote: I like it +20 Vote: I do not like it

The e-mail about this round contained a wrong date. It said January 4th instead of December 27th

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Is it rated

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Maybe we can still encounter in the next year!

»
8 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

[deleted]

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

HAPPY NEW year who can give to me 5 dollars or 5$

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
Hoping to see all the verdicts this way!!
»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I am a beginner ...should i register in this contest ?? Are there any easy questions??

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good Bye 2025,This is the first year I'm truly planning to compete.

»
8 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

As not an is-it-rated-er, isn't it rated?

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I hope everyone becomes LGM after this round

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What's wrong with the color and rating? 1400 rated profiles are shown in red. Highest rated user @kevin114514 is shown in cyan. I'm seeing too many anomalies across multiple profiles. Anyone else facing this issue?

»
8 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

I hope that I can solve 5 problems and get MORE and MORE ratings!

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
  • Good Bye 2025
  • Educational Codeforces Round 186: 29.12.2025 17:35

Hmmm

"Goodbye, 2025! Oh, wait, one more round... Ok, bye-bye!"

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

;)

»
8 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

what's nutella testing?

UPD: Oh LGM's handle color is the same as nutella's.

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hope all of us could work out one more question! Marry Christmas!

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I hope to reach pupil today !

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

hope to solve 3 problem

»
8 months ago, hide # |
 
Vote: I like it +39 Vote: I do not like it

The queue is slow again for me today :(

»
8 months ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

IN QUEUEE!!!

»
8 months ago, hide # |
 
Vote: I like it +34 Vote: I do not like it

In queue ... after 20 minutes ... Gift labels got mixed up for delivery 2

»
8 months ago, hide # |
 
Vote: I like it +34 Vote: I do not like it

This is some CRAZY queueing :(

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

__baozii__ comes again!!

»
8 months ago, hide # |
Rev. 2  
Vote: I like it +10 Vote: I do not like it

3 hours for contest with no subtasks feels too much

»
8 months ago, hide # |
 
Vote: I like it +46 Vote: I do not like it

Yes obv 10k people solved Problem C during contest. Nice joke.

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    yeah , i dont even know like how u progress with it like 0 idea thats not n^2 dp , how are people doing this shit :[

    • »
      »
      »
      8 months ago, hide # ^ |
      Rev. 4  
      Vote: I like it +8 Vote: I do not like it

      Call operation 1 as taking the first element and operation 2 as taking the second element from the current array

      Let $$$a_i$$$ be the remaining element.

      We can prove that the maximum cost required to remove elements before $$$a_i$$$ is equal to:

      $$$a_0 + \sum_{j=1}^{i-1} abs(a_j)$$$

      Proof

      We can also calculate the required cost to remove elements after $$$a_i$$$, which is:

      $$$\sum_{i+1}^{n} -a_i$$$

      Proof

      Both of these can be preprocessed in $$$O(n)$$$ time. For every $$$i$$$, fix $$$a_i$$$ as the remaining element and calculate maximum cost over all $$$i$$$

    • »
      »
      »
      8 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      so ultimately you are not taking exactly 1 element , lets suppose you didn't take the element i , then this element will always be at the first place and any element after it will be at the second place so they will contribute to X as — (w[i + 1] + w[i+2] .. ) , now any element before i can be taken in both positive as well as negative forms except the first element as it is bound to be at the first place , hence this part contributes w[0] + abs(w[1]) + abs(w[2]) .. abs(w[i-1]).

      So, basically we iterate over all the indices and take the maximum answer using the above logic

      I also thought of dp , but then i realised the constraints are high also there are too many submissions to it :)

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

D solved 3500+??!!! what did i miss?

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    same. how to approach D?

    • »
      »
      »
      8 months ago, hide # ^ |
      Rev. 2  
      Vote: I like it +6 Vote: I do not like it

      For $$$m \gt 0$$$, if $$$m \gt n/2$$$ it's impossible (each attack kills at least one elf, and calms at most $$$2$$$ (the attacking one and, if they died, the defender). Otherwise, you can sort the elves, let $$$n-2*m$$$ weakest elves attack the next stronger one (and die in the process), the split the remaining $$$2*m$$$ into pairs and let the stronger one attack the weaker one. For $$$m=0$$$, if the sum of all elves except for the strongest is less than the health of the strongest, it's impossible (they can't die), otherwise let $$$k$$$ weakest elves attack the next stronger one and die, and let all other elves except for the strongest one attack the strongest one and die, where $$$k$$$ is chosen in such a way that the last attck kills the strongest elf.

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it -22 Vote: I do not like it

    ChatGPT

»
8 months ago, hide # |
 
Vote: I like it +37 Vote: I do not like it

Good problems, bad queues.

»
8 months ago, hide # |
 
Vote: I like it +39 Vote: I do not like it

submit and pray forces

»
8 months ago, hide # |
 
Vote: I like it +19 Vote: I do not like it

"Good Bye Rating" ahh contest, for me, couldn't solve D :(. Either way, nice contest!

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can somebody explain the test 7 output in problem D please ;-; I was stuck there for like 2 hours Why would it be like that? After all the operation all a isnt 0?

  • »
    »
    8 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it +4 Vote: I do not like it

    Attention: $$$h_i$$$ may decrease but $$$a_i$$$ will never change.

    x = 3, y = 1
    h[3] = 314159265,        h[1] = 998244353
    a[1] = 998244353,        a[3] = 314159265
    h[3] -= 998244353 => 0,  h[1] -= 314159265 => 684085088
    3 died.
    
    x = 2, y = 5
    h[2] = 1000000000,       h[5] = 999999999
    a[5] = 999999999,        a[2] = 1000000000
    h[2] -= 999999999 => 1,  h[5] -= 1000000000 => 0
    5 died.
    
    x = 6, y = 1
    h[6] = 987654321,        h[1] = 684085088
    a[1] = 998244353,        a[6] = 987654321
    h[6] -= 998244353 => 0,  h[1] -= 987654321 => 0
    6 died, 1 died.
    
    x = 4, y = 2
    h[4] = 676767677,        h[2] = 1
    a[2] = 1000000000,       a[4] = 676767677
    h[4] -= 1000000000 => 0, h[2] -= 676767677 => 0
    4 died, 2 died.
    

    Hope this could be clear.

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Did anyone that got WA test 4 for E figure out what their bug was?

»
8 months ago, hide # |
 
Vote: I like it +15 Vote: I do not like it

D>>E

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone explain idea for D? Looked like a graph problem

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Try to get yourself in a position where after sorting, the number of that should be alive are half the total remaining. So you can just attack the first half with the second

  • »
    »
    8 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    sort elves by health (!note that health is unique)

    if m > 0, preserve the m elves with most health, make them kill the smaller ones, and the smaller ones kill the even smaller ones.

    if m = 0, make the smallest ones attack on the biggest elf but one step from killing it, then from that step make the rest elves kill the one that is to the left of it.

    also you need to handle the cases when impossible. either 2*m > n or m = 0 and all the n-1 elves combined can't kill the biggest one

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it
»
8 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

No way, i submitted D 3 seconds before the contest ended, it shows contest is over !!

There was a typo in my previous code.

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it +9 Vote: I do not like it

    I had 2 typos in my D code, first one caught immediately after submitting,
    thankfully wa on test 1,
    second one didn't know it until long ass queue told me wa on test 2

»
8 months ago, hide # |
Rev. 3  
Vote: I like it 0 Vote: I do not like it

editorial page isn't working!!!,btw nice problemset,thanks for the contest!

upd:it's working now!!!

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Just gave the contest, was really happy for solving D. Pheww, might be the toughest one I gave till now ( a personal opinion from my side alone)

»
8 months ago, hide # |
Rev. 2  
Vote: I like it +30 Vote: I do not like it

Now I only wonder how you managed to find such five extremely special examples of answers in F.

Btw the magic is real. I will really drop to my current color lol.

»
8 months ago, hide # |
 
Vote: I like it +39 Vote: I do not like it

G is impossible to solve :( Nice problemset btw

»
8 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

GG guys, good contest, happy new year everyone! I wish I had more time for Codeforces, but life and work carried me away.

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

A very nice contest to end the year (though technically not the last) Problem D was nice and too hard for me to solve :)

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I've spent 2.5 hours on C. Had zero previous DP experience (did not yet get to the theme), and wasted time scanning through the manuals (I genuinely thought it must be one). Fun fact: if I had prevous DP experience, I would have easily noticed that it is NOT DP at all, it is a tricky constructive.

After all it was like an hour trying to set all the prefix-suffix indices to work properly, which turned out to be quite a challenge. Very happy to get a working solution in the end.

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    yeah exact same thought process, but couldn't get the code running till end. But it has nearly 10k submissions. like that ques was not this straight forward.

    • »
      »
      »
      8 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Well, the cheaters rate in the last year has skyrocketed. Or (maybe) a lot of new skilled people joined. Which one, I guess...

      • »
        »
        »
        »
        8 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        I just tried using LLM to solve C (certainly after contest). It almost gave me the correct answer... So I think many people that solved C may be cheaters?

        • »
          »
          »
          »
          »
          8 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          I am still waiting for someone to research, what is the rating where free LLMs start making errors in solutions.

        • »
          »
          »
          »
          »
          8 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          yes highly likely.

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Some submissions had implemented it using Dynamic Programming too. I noted in a few on the top of standings, for example: Kevin114514, Radewoosh.

»
8 months ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

The queue was kinda bad. At this rate, we might as well remove pretests altogether and only have systests.

»
8 months ago, hide # |
Rev. 3  
Vote: I like it +8 Vote: I do not like it

in D, why is recoil considered an attack?

intuitively, i thought the attacks are like directed

- "Then, elf x attacks elf y"

x attacks y doesnt mean y attacks x is what i thought

its like u punched a wall and got hurt so u tell everyone the wall hit u

edit: mb gng, im dumb af

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I have been thinking about randomization in E for over an hour,but the solution is correct in any case.The solution was amazing but perhaps the disablement of hacks and the non-adaption of the interactive problem is more likely to make participants not think about that.

»
8 months ago, hide # |
Rev. 2  
Vote: I like it +1 Vote: I do not like it

in queue... after 20 minutes tell me that there is a compilation error!!

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Rate up!

»
8 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

What a bad night! I got WA 6 times for D and E, which means 12 WA in total, even though I came up with the correct solution for D. I got so many bugs=(((( But after all, this was an excelent contest. Thanks a lot to writers and testers.

»
8 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Very good problems, thank you! Enjoyed thinking over D and E. Round was very balanced.

»
8 months ago, hide # |
Rev. 2  
Vote: I like it +10 Vote: I do not like it

10k solves on C -_-

Edit: great contest though! Thank you to the authors

»
8 months ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

sus comments javabidov please take a look at his comment block on top YuukiS twosquares his submission 355400798

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve E? I get WA on test 3, when I use binary search for it. I compared sum of l to m divide m+1-l and sum from m to r divide r-m.

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I did the same and found the flaw, let's say 8 8 8 8 8 gives the same sum of 8 8 16 4 4... it's no good for this approach

»
8 months ago, hide # |
 
Vote: I like it +16 Vote: I do not like it

damn i wonder what the solution to this problem might look like

»
8 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

You are SUS

»
8 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Great contest with good quality problems. First time solved 6 problems in div1 + div2 round, a perfect goodbye.

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good bye 2025! First year doing codeforces and many more years to practice to come. Happy holidays and a good 2026 to everyone.

»
8 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

C was really good

»
8 months ago, hide # |
 
Vote: I like it +72 Vote: I do not like it

Guys, there are 2 C# submissions that won't judge

»
8 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Why do the judging system stuck with these two C# submissions?

»
8 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Good Bye C#

»
8 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I wonder if the C# situation is somehow related to: https://codeforces.me/blog/entry/148770

»
8 months ago, hide # |
 
Vote: I like it +32 Vote: I do not like it

This is probably the best round I've ever participated in. I enjoyed solving the problems, especially upsolving G.

»
8 months ago, hide # |
 
Vote: I like it +18 Vote: I do not like it

the problem E is awesome!so interesting,i like it.

»
8 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Me before the contest (1)