BernatP's blog

By BernatP, history, 8 months ago, In English

Hello, Codeforces!

We are pleased to announce the resumption of the Global Rounds. Thanks to XTX Markets for supporting the initiative! In 2025, we will hold 3 such rounds. The series results will take into account the best 2 participations out of 3.

On Sep/20/2025 17:35 (Moscow time) we will host Codeforces Global Round 29 (Div. 1 + Div. 2).

Codeforces Global Round 29 marks the first round in the 2025 series of Codeforces Global Rounds. These rounds are open and rated for everyone.

The prizes for this round are as follows:

  • The top 30 participants will receive a t-shirt.
  • 20 t-shirts will be randomly distributed among participants ranked between 31 and 500, inclusive.

The prizes for the 3-round series in 2025:

  • In each round, the top-100 participants get points according to the table.
  • A participant's final score will be the sum of the points they earned in their 2 highest-placing rounds.
  • The top 20 participants across the series will receive sweatshirts and placement certificates.

We extend our gratitude to XTX Markets for supporting the global rounds initiative in 2025!

The problems were written and prepared by misteg168, FelixMP, Pablo-No, danx, MeGustaElArroz23, Clan328 and me.

We would also like to thank:

Round Information:

  • Duration: 3h
  • Number of problems: 9

UPD: Score distribution: $$$500 - 1000 - 1500 - 2000 - 2500 - 3000 - 4500 - 5500 - (4000 + 3500)$$$

UPD2: In this round, some of the problems will feature interactive visualizers that can help you to play around with small test cases. These are not part of the problem statements, although we tried our best to make sure that their behaviour correctly follows it. You can investigate examples or your own tests in more details with them. Note the following:

  • the visualizers use javascript in your browser to work; you don't need to install anything additional;

  • we won't be able to help with the visualizers during the round.

Picture of authors (and some testers) (and some non testers):

We eagerly anticipate your participation!

UPD3 Congratulations to all the winners!!!

  1. ecnerwala
  2. jiangly
  3. ksun48
  4. Benq
  5. heuristica
  6. turmax
  7. strapple
  8. Nachia
  9. hos.lyric
  10. Kevin114514

UPDT 4: Editorial is out: https://mirror.codeforces.com/blog/entry/146633

  • Vote: I like it
  • +375
  • Vote: I do not like it

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

Auto comment: topic has been updated by BernatP (previous revision, new revision, compare).

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

the goats themselves are running a round! lfg.

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

Is it rated?

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

As a tester, I liked problems from this round more than from CAMA, which had really nice problems. Orz authors.

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

    that hurts bro

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

    Nemanja, you absolute galaxy-brained mastermind… normally your words descend from Mount Olympus like divine wisdom itself. But this time… oh boy. This round is cool, sure… but saying it’s better than CAMA is like saying a candle outshines the sun.

    CAMA isn’t just better… it’s a whole separate lifeform, it’s peak evolution, it’s the final boss of awesomeness. CAMA >>>>>>>>>>>>>>>>>>>>>>>>>> reality itself.

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

oh wow !!!

I love how the colors of testers are named with a fruit .. very creative.

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

Spanish round omg :O

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

As a tester of teamscode, I'm excited to see danx in the author list.

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

    I'm always excited,but after reading your comment, my excitement just got… more excited. Not quite as excited as that time I slept next to an almost-naked Esomer, but still dangerously close. Long, happy and exciting life to you and TeamsCode!

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

If there was a cyan tester, which food would it be?

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

Where is __baozii__?

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

As a tester, Barça is the best team in the world (find me in the photo) :)

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

As a setter, I'm dyslexic

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

As a tester, i told all my friends to participate as the round is really high quality and has lots of nice problems!

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

as danx boyfriend, Esomer is the sexist (and sexiest) tester in the world, only cause Dalek_of_Rivia has not tested yet

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

i interested part of coder gang but my codeforces rating is low

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

the colors for eggplant and blueberry emojis are swapped wrt the cf role colors and its driving me insane

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

[deleted]

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

Excited for Global Round 29! Thanks to all authors, testers, and coordinators for their hard work.

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

As a tester, I am sure this is what happened for many of you when you saw Global Round happening in 2025.

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

The goats are awasome

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

Can we have Orange Testing Instead of Banana

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

orz danx

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

Auto comment: topic has been updated by BernatP (previous revision, new revision, compare).

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

__baozii__ fan are crying in this contest lol

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

Wishing everyone has a blast in this competition!:)

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

Visca!

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

Hoping that the small baby in my DP (display picture not dynamic programming ^_^) will smile till end of September :).

»
8 months ago, hide # |
 
Vote: I like it -31 Vote: I do not like it
rating += 4000 - 1515;
»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

$$$5500$$$ points? That's incredible bro

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

the visualisation feature is so sick....love it...hope it will be in future contests as well...

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

lol what happened to problem G?

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

    There was a lot of cheating on this problem, which is why there were many in-contest solves. Cheaters will be banned. We’re sorry if the high solve count during the contest misled anyone, but please understand that this isn’t something the authors, coordinators, or codeforces can control.

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

    114514

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

how are many coconut handles able to solve G but not E and F *_*

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

The contest is roughly good and I love the format that most of problems have their visualizer... but what happened in the AC count of G?

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

    There was a lot of cheating on this problem, which is why there were many in-contest solves. Cheaters will be banned. We’re sorry if the high solve count during the contest misled anyone, but please understand that this isn’t something the authors, coordinators, or codeforces can control.

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

      Please hurry and ban them or I'm going to lose rating

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

      I was so shocked this situation happens, this scenario can collapse the meaning of the standings dualing the contest totally... (should I use friend-feature to create "legit" standings then?)

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

    i think it's gpt-able

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

A bunch of cheaters between rank 100 and rank 200. They are all newbies and they cannot solve E and F, even D, but they can solve G. Please check if their code is AI-generated

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

    There was a lot of cheating on this problem, which is why there were many in-contest solves. Cheaters will be banned. We’re sorry if the high solve count during the contest misled anyone, but please understand that this isn’t something the authors, coordinators, or codeforces can control.

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

      I understand. The problems are very good, and removing the cheaters is the responsibility of admin, not yours.

      I am also going to holder my own div2 contest. (still need 5 or more testers), hope cheaters will not ruin my contest.

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

    YES! They are cheaters!

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

Please ban all cheaters that solved G with ChatGPT

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

    There was a lot of cheating on this problem, which is why there were many in-contest solves. Cheaters will be banned. We’re sorry if the high solve count during the contest misled anyone, but please understand that this isn’t something the authors, coordinators, or codeforces can control.

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

What had happened on G?

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

    There was a lot of cheating on this problem, which is why there were many in-contest solves. Cheaters will be banned. We’re sorry if the high solve count during the contest misled anyone, but please understand that this isn’t something the authors, coordinators, or codeforces can control.

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

Comment below if you solved G completely by yourself(like me ^.^)!!

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

AI could pass G

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

gambleforces

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

D and C are very good problems

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

C was a very neat problem and I enjoyed solving it even if I got +8 in penalties.

I then got to D and got it in 20 minutes with a guessed solution :/

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

problem C alone costed me almost 250 perf....

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

Dislike most problems. Hard and strange. D<A<B<C.

Almost solved F with some $$$\mathcal O(n\sqrt n)$$$ solution.

I'm losing hundreds of rating. Probably contribution as well.

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

    I think it's more like an AtCoder round. My brain is not enough for this :(

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

    I have no idea how people can enjoy today’s contest, especially the Div. 2 participants. The first four problems weren’t interesting at all. B and C felt like torture to me, and by the time I reached D I was completely exhausted

    UPD: upsolved D, ok, that is good problem

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

    update: Problem F 339613954

    -78 rating :(

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

AIforces

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

C>>>>>>>>>>>D

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

Is C was like a prefix sum question where you have to find the minimum distance of a 0 to another zero (left and right) and if the distance is greater than 2 then the answer is false otherwise it is true.

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

    no

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

      so can you explain me the solution that you have applied.

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

        In the case of 1010101, the distance is 1 in between all zeroes, yet (if I understood correctly) there is no way to make the rabbits not jump. Either the first two face eachother and the last makes a jump, or the last 2 face eachother and the first makes a jump, unless I am mistaken.

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

        for C you just had to do a simple reduction.

        if there are consecutive 0's (empty pots), you can imagine there's a wall between them.

        so 011001001 is equivalent to three separate problems that are easier to solve 0110, 010, and 01

        now for each subproblem, you just check the number of zeros in chains of 0101010s. if its odd and none of the zeros is on a border, then its impossible.

        339557173

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

          why consecutive zeros might lead to a wall between them ?

          A: but they won't jump if there is a rabbit in that pot already

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

        the main idea is that you solve the problem for groups of 0's that are not separated by more than one 1 indepandently , because when there are 2 consecutive 1's the rabbids from previous positions can not interact with rabbids in the next positions (this is the most important idea) . now when you have a group that we described earlier you can see that when the count of rabbids in that group is even you can always pair them up and none of them can escape , for example : 10->1<-0 and so on , now we can expand this to odd count of rabbids at one condition : "there are at least 2 consecutive rabbids in the group" , because we can do this : 10->1<-0(<-0)1 , so we pair (cnt-1(even)) and the last one can see in the direction of its blocked neighbour , although i don't have a formal proof of why it won't work otherwise i think it is pretty intuitive . you can refer to my implementation : submission

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

I saw that there were more AC in pG than pF, so I spent all my time to solve pG. Then my rank drop from 30 to 200...

I regret my decision.

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

Problem C and D should have been swapped.

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

Way to many cheaters on G

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

Just ban everybody below CM who solved G but not E or F. The chance of false positive isn't big anyways

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

worst contest(performance wise)for me -160 :(

Started 1:10 hours late thought i would cover it but f'ed whole contest. But will upsolve

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

Thanks for the round!
The problems are interesting and diverse enough.
The visualizers are a nice touch, hope to see more of these in the future.

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

To be honest, I really don't like C. There are too many edge cases and I got 8 Wrong Answers but still didn't solve

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

    When one tries to solve a problem by exhausting "edge cases", and these turn out to be too many (i.e., not edge cases at all), it isn't the problem's fault.

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

      I'm sorry I think i should describe it as "The edge cases are too hard to find". The problem is that I really don't know where did I do wrong and it becomes super annoying. There are a lot of test cases but only 1 or 2 of them are strong. You can observe that there are many people attemped the problem but did not get AC.

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

        Nah, my point is, rather: if you have more than say 3 "edge cases", usually it's time to rethink the solution from the start, not to find 5+ more edge cases for the current solution.

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

        There aren’t really edge cases tbh. There’s one important case: 101 and 10101. If there’s an even number of 0’s -> true, odd ->false. All other cases are trivial, a string of 1’s or 0’s is obviously true

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

        When your approach is a bit off track then you'll get wrong answer. This is why I don't like this problem.

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

        I guess this just depends on your solution, as I didn't have to add any extra condition for edge cases(there was just no edge case for me).

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

    C was kinda a mindfuck but really the only case that mattered was the alternating case. Repeating 1s or 0s was trivial.

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

Great round! Especially balanced difficulty of problems

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

why my C 339573079 got WA on test 2?

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

I got trolled by rand on B, it cost me about 20 minutes and a bunch of TLE submits, and i got ac once i switched to mt19937. Cautionary tale to never use rand, i guess i finally learned that the hard way lol

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

    there was a construction so rand was really never needed

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

      Funny story, there was an incredibly similar problem in the 2024 AMO:

      is it possible to construct array of length 12000 such that there are 1000 of each number from 1 to 12 and the distance between every pair of equal elements is divisible by it

      so i used the solution to that one instead of looking for a construction

      ironic that prior knowledge of a generalised version of the problem made me perform worse

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

can I solve problem C in DP??

dp[i][0] : ith cat can see left

dp[i][1] : ith cat can see right

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

Why did I1 and I2 only have 2 testcases

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

How to approach C ?

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

    There is 2 solution , dp and greedy

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

      339573079 Is there a edge case I missed?

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

      what is the greedy way of doing ?

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

        There are some edge cases for the first and last elements of the string. You can think of it yourself. For the general case, for any substring of the form 110...011, you can see that thus substring can never affect any other part of the string. So, basically, any substring that has 11 after and before it will be independent. We can remove these extra ones in the prefix and suffix of these substrings and get something of the form 0...0. For these type of strings, it is possible to arrange the rabbits if and only if there is either any substring of consecutive 0s in it, or the number of 0 is even. You should try to prove it yourself. If all independent substrings can be arranged correctly, the answer is yes, else no.You can also check my code

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

          are you saying that you created different pools of substring such that to its left and right there is 11?after that you processed that substring and checked whether you can do what is asked to do in the question?

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

            Yes. There are some edge cases for the first and last element. As an example, if the substring has the first or the last element in it, amd it’s 0, its also always possible to create an arrangement for that substring. Basically decompose into substrings that are independent, and find if all of them are possible.

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

              oh ok ok.

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

              also if there are consecutive zeros like 0000 we can ignore all the zeros in middle and take only the 00 right?this is what we will be doing in your approach right?

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

                No. That substring will be possible as there are consecutive 0s. My solution and the author's is basically the same.

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

      how to do using dp?

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

        Let's say there is ask(int X) function which will tell us wether we can arrange rabbits from level X to n

        Now suppose we are at level a, then there are multiple transition we can make

        If pot[level] == 1 means there is grass then we don't have to worry about it and answer for level a is same as ask(a+1)

        If pot[level] == 0 then either it's immediate right has to be rabbit or immediate left or if immediate right is grass then immediate right to right has to be rabbit , now we have to call ask function according to the transition we made

        Ask me if you have any doubts or you can check my code

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

    This might seem difficult than others but it seems easier to reach this solution if you knew this. It can also be solved using simple Bipartite check for a graph.

    1. if there is only one 1 between two 0s then both should be having different directions. So we can add an edge to the graph.
    2. if there is more than one 1 between two 0s then both should be having the direction opposite to the 1s. So the direction is fixed(left one should be left and right one should be right).
    3. if there is a one 1 in the end then also the nearest 0 should be facing away from the 1.

    Run the dfs and check for bipartite.(Start from all the vertices already having a fixed color/direction)

    Note: There is no restriction on any zero that does not have any adjacent 1.(Could be in any direction)

    Submission: 339613547

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

was G google searchable or chat gpt-able? so many of CM solved ABC and then G. what the hell?

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

    I can bet on the fact that many CMs (not all) could not have even interpreted what the problem is stating, leave alone coding the solution !!

    And people who are Grey, Green and Cyan should not even think about defending themselves !!

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

      I was not even able to reach G , how did so many people solve it

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

      you are ratist pro max

      PS: I could not solve it, even though I knew that in $$$O(log(m))$$$ steps, the series converges :/

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

        I am talking about those who have submitted the accepted solution !!

        I know everything is not about rating but you seriously think problem G of a Global Round with so many Red testers (generally 3100 rated) can be solved by so many contestants who can't even solve E and F and directly attacked G..

        Obviously: I explicitly mentioned not all.. There are always exceptions but here we are talking about larger chunk.

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

    Google search only yields some special case on mod $$$5^k$$$ (many papers stated that they are looking for something like "freezing trailing digits in tetration") as what I got when I tried Googling. Also tried searching for papers on Google Scholar but get no solutions.

    GPT is illegal in contest so I didn't try.

    (can't even submit once on pG cuz I can't think of a solution lol, although spending more than half of my time and skipping D, E, F for it. Would be appreciated if someone can provide a solution here)

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

    I could not solve it, but it is project euler right? I remember that in $$$O(log(m))$$$ steps, we have the result for all tetrations independent of $$$n$$$.

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

    Ban ALL those shitty cheater CMs. Completely delete their account and shadow ban their IPs. MikeMirzayanov

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

How to do C

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

I think G is a good question, but with so many AI passing through this question, these people, especially Indians, should be severely punished

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

    Don't say Indians bro, Instead say cheaters. Lol even you also took a new account and participating in contests instead participate with your old account itself.

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

How to solve D??

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

    https://mirror.codeforces.com/contest/2147/submission/339575538

    I just guessed the solution, but it got pretests passed, the only issue I could think of when the testcase is something like, 1,1,2,2,3,3 but my code is passing that case as well, not sure what will happen after System testing is complete...

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

    Even numbers :- both will get same number of points no matter what

    Odd numbers :- this is the game changer,because one will get (x/2) and other will get (x/2) + 1 times.Thus both will prefer odd numbers with max_freq. So just take <x,freq> pair sort it in desc order,on alice's turn she will get (x/2)+1 times the freq and bob will get (x/2) and on bob's turn he will get (x/2)+1 times and alice will get (x/2) times.

    For even numbers :- both will get (x/2) times the freq.

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

Contrary to most people I solved C and E but not D lol. I would love some logic on D.

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

    At least in my solution, you don't need to consider the case where a number changes into another number (i.e. 2 2 3 3 -> 2 2 2 2)

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

    my approach was a bit simple.Create a vector of pair storing frequency and the number and then sort it in non increasing fashion. Now alice will start first, as he is starting first he will get upperbound of that number i.e frequency*(number+1)/2 and bob will get frequency*(number)/2. Now the only thing we need to understand is who will start picking first when the next number starts which is simple to find, if the prev number was odd and alice started then for the next number bob will start first and vice versa. For the even number the person who picked first prev will pick the next one first as well.

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

Thanks to the authors, nice round! There are a lot of cheaters on G, I hope you'll check them out. I was also confused by this, I passed a n^2 solution in F(TL 4), but decided to leave this task and switch to E because of the small number of OK on F. Although without mass cheating, I think a lot of people would have passed F.

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

my best

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

How to solve E?

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

    First, we prove an important lemma: There exists an optimal set of changes such that every set bit in the OR is either set before any changes, or is a part of a suffix containing only set bits.

    Proof

    Now, for each possible suffix of ones, we calculate the minimum number of changes required to reach it. To do this, we can just go bit by bit starting with the leftmost one, if it's already set, do nothing, and if it isn't, change the number with the highest remainder modulo respective power of 2 (only these modulos matter now, as higher bits can't be unset by doing this and the required ones are already set). Calculate this for every bit, get the minimum number of changes for every suffix length, and then for each scenario, just pick the longest suffix of set bits that's possible. Time complexity is $$$O(n log^2(n))$$$.

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

      But when we are calculating the minimum number of moves for a suffix, our past moves matter, because by adding to one of the numbers in the array you might lose one of the bits on the right.

      I don't understand why your greedy approach for the last part works

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

        Because you need to somehow get to that bit, so you need to change some number to set this bit, and changing any other number than the maximum after modulo can be simulated by changing the maximum to set this bit, then changing the other number to the maximum (actually its modulo), which takes the same amount of steps, so you don't lose anything by just changing the maximum.

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

          I still didn't get the proof of greedy strategy to have all k bits in suffix set to 1 , setting only kth bit to 1 is trivial whichever has maximum modulo, needs least op but how does it work for suffix k bits?

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

oh, B is too hard for me. I only managed to solve it at 2:53

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

Was G GPT-able? I saw that more people were solving G then F and decided to skip F, so it affected my result even discounting the people who passed me unfairly...

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

Guessforces!

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

what special property does G have that it was solvable by GPT despite being so hard!?

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

Is there a method to come up with a solution for constructives like B? I could only do trial and error.

Great problems tho :)

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

    though I guessed by intuition , each i from 1 to n-1 will have distance 2i , and n will have distance n. So the sequence would be like n , n-1 , n-2 , ..... , 1 , n , 1 , 2 , 3 , ..... n-1

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

      Woahh, thats way simpler than the bs construction I used, thanks xD

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

      it took me an hour to come up with this

    • »
      »
      »
      8 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it
      • Basically it is: [ n-1, n-2, n-3, ..., 1, n , 1, 2, 3, ..., n-1] , then you can print an extra n at the starting or end of the array.
  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it +6 Vote: I do not like it

    You can try printing all answers using brute force, and then try to see the pattern.

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

    :)

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

Abolish combined rounds (to clarify: I enjoyed problems, but problem G situation is crazy, I regret solving it over F based on standings:/)

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

Problem F is really beautiful, thanks!

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

Now let's test GPT 5 Pro, which is granted for the participants of ICPC WF 2025!
G seems really GPT-able. chat
idk it's actually correct, but it passes the samples and some tests compare with AC submissions.

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

    Thank you for sharing that (jokes aside). I see extremely similar and very suspicious solutions in my friend standings and this is really helpful for me to know.

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

    Bro, actually gpt-5 PRO solves anything, H solution, idk why cheaters don't get TOP1 during the contests(I am not very familiar with modern technologies, so there is a chance that chatgpt googled the solution, but it says it didn't and I tend to believe it)

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

I like contest problems even though I am cooked, excited to know the solutions

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

going to lose lot of rating :( couldnt come up with a solution for B after staring at it for an hour and then -8 (wrong answer on testcase 2) for C.

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

Thank you for the round! B felt harder than usual but D and E were very cool.

I enjoyed working on G although I wasn't close to solving, sad to see that it was trampled by cheaters.

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

    I actually find B very fascinating... Indeed, it took me way too long. But in retrospect, even though I did find a viable pattern, I know there was a more methodical approach. Particularly, I remember stumbling onto the fact that you could stack even or odd numbers onto each other. Additionally, that most numbers could be placed at a distance of 2x from each other, and not just x. Put the two and two together and you get a trivial pattern. For some reason, I didn't internalize that second point enough and didn't try to draw a conclusion like that. So I guess for future reference, look for more properties instead of looking for patterns?

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

      Hi fellow 199!

      Yeah it was a skill issue on my part. I remember staring at something of the form 53113542x24 for 30 minutes without any thoughts on how to vacate the x, but during the time I could've sought other constructions. If I tried writing a brute force I also could've solved sooner.

      In general, maybe it's an issue of "too much thinking, not enough solving" ;(

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

        omg, I didn't even realize xd

        btw, weren't you also at the wf in Baku? Ain't that an interesting coincidence...

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

Why are we unable to see hidden pretest yet??

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

Auto comment: topic has been updated by BernatP (previous revision, new revision, compare).

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

Editorial?

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

Can anyone help me debug the code for Problem C. I used greedy, first fixing the direction of rabit for those pots where they dont have any other option like 11010 or 01011, then find if I can find the pair for them and then for rest of the rabbits which have options chose them greedily for left or right. Left those on the border or consecutive 0s as they always find a direction to not jump: https://mirror.codeforces.com/contest/2147/submission/339602741

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

204 solves currently for G. Excited to see how many solves after removals.

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

Auto comment: topic has been updated by BernatP (previous revision, new revision, compare).

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

Wasn’t d easier than c?

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

Auto comment: topic has been updated by BernatP (previous revision, new revision, compare).

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

For D, in this tc:

1
3
3 3 1

answer should be 5 2 right? I see multiple AC submissions that give 4 3.

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

can anyone please tell me why my solution for E couldn't work.

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

Problems were really Nice , don't know why there were that many G submissions though

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

I know many people are hurt by what happened with G situation and I understand the disappointment. I would like to ask to not direct any hate towards the authors though. As a tester, I can confirm that they spent a lot of time working on the round and making the problems for you to enjoy. And they are even dedicating more time to catch as many cheaters as possible. They are more upset about the situation than any of us.

So please, don't give cheaters all the attention and praise the authors for the work they put in to make this round possible!

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

is problem B == Leetcode 1718 ?

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

    Not exactly, in B you must use two copies of 1, meanwhile in this problem 1 must only show up once. The problem you linked also does not allow distances to be multiples of the number, and you must output the lexicographically largest array possible rather than B which does not have that requirement.

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

I hope that authors will always be given pre-tests like these.

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

Are the tests for Problem D correct? My solution passes the maximum test, but gets a time limit on the smaller test.

UPD It's really anti-hash test?

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

    Well, it was a hack that was added to the testset after the contest (which is a standard practice). I don't really know what we should have done differently in your opinion. Have it in pretests in the first place? Don't add the hack to the tests?

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

      Good answer, but it would be better if you also good checked the tasks in the GPT before the round.

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

Recur + memo approach for C := 339626295

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

Thanks for the round:

  1. Unexpectedly solved ABCD and delivered one of my best performances.
  2. Solved G on paper in the remaining time, up to deriving the formula, but couldn’t implement it. 2147G NT approach.
  3. D failed after retesting because of unordered_map. A few days earlier I spent a long time on ABC 418E where map TLE’d but unordered_map passed. I studied it superficially and used it in D today, which cost me the problem. Now I’ll study it thoroughly.

The main thing isn’t the delta, but persistence in understanding concepts, starting from the simplest ones. Today my “persistence delta” grew a lot thanks to the contest.

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

Thanks to this contest because I've become a pupil now. The problems were delightful. And, C was just awesome. I found a greedy solution for C. Most of my friends wrote a DP solution for C.

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

What do you call Specialists?

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

will cheaters be removed from the standings and ratings recalculated?

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

    We will try. It is hard to prove they cheated but I can ensure we will ban as many as we can

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

    It seems that the authors have banned many cheaters, and the top 100-200 no longer looks the same as before

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

Spent all my time trying B, then I heard some coconuts solved G :D

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

I was just scrolling through the top ranks and the number of obvious cheaters is unreal. It's not just G! They clearly used GPT to solve A,B,C,D as well. Someone has said that GPT-5-Pro could even solve H. At this point, we need chess.com level detection of cheaters to make these contests fun again. Feeling really bad for the setters, testers, and honest participants. So many greys have outscored IGMs :(

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

Decided to upsolve I1 since I didnt look at the contest until a lot of time already passed, so I just looked at the hard problems that looked feasible to solve. It was actually a really cool problem. Interestingly enough, this problem shares a technique with a problem I already knew before.

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

My DP solution to C: 339573488

I was comparing with what I did at (i-2) to calculate for the ith state, Here the second state if:

0: Means a plant

1: Rabbit placed left looking

2: Rabbit placed right looking

But as it is dependent on (i-2), I calculated manually first all starting [0][0], [0][1], .. [1][2] 24 states for initialization. How to think of better dp states or how to modify solution in better way.

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

Tried to solve F during the contest and afterwards — it seems that my "DCP-style" solution in $$$Nlog^2N$$$ is too slow and gets 5s to work (and $$$\ge$$$ 256Mb memory) (checked with changing TL / ML in mashup)

Well, at least it works! (Now it's time to check the authors' approach)

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

    My rating suffered from skipping D, E and from not being able to participate unrated..

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

    This was actually the first solution we came up with.

    Try to think of another way of doing a segment tree such that you can erase ranges, I believe you have solved the first part of the problem.

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

Thanks for the contest. The Contest was amazing!!!

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

My solution for problem 2147C - Rabbits is 339594760. Time Complexity O(N).

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

Will there be rollback?

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

Congratulations to tshirts winners! In a few weeks you will be contacted via private messages with instructions to receive your prize.

As usual, we used the following two scripts for generating random winners, seed is the score of the winner.

get_tshirts.py
randgen.cpp
List place Contest Rank Name
1 2147 1 ecnerwala
2 2147 2 jiangly
3 2147 3 ksun48
4 2147 4 Benq
5 2147 5 heuristica
6 2147 6 turmax
7 2147 7 strapple
8 2147 8 Nachia
9 2147 9 hos.lyric
10 2147 10 Kevin114514
11 2147 11 dXqwq
12 2147 12 antekb
13 2147 13 jiangbowen
14 2147 14 kotatsugame
15 2147 15 Nyaan
16 2147 16 _wrz_
17 2147 17 literalchild
18 2147 18 OrangeEye
19 2147 19 Su_Zipei
20 2147 20 Flamire
21 2147 21 lotusblume
22 2147 22 7etuPr0mK_X-VPA.8-ER1SYJ
23 2147 23 cdxcdxcdxcdx
24 2147 23 yosupo
25 2147 25 Dominater069
26 2147 26 Tlatoani
27 2147 27 thenymphsofdelphi
28 2147 28 zltzlt
29 2147 29 cn449
30 2147 30 antontrygubO_o
108 2147 108 JYJin
118 2147 118 abs0lute
157 2147 157 peti1234
158 2147 158 Watersphere
160 2147 160 maxplus
181 2147 181 ArturSmolenski
259 2147 259 XZRSEVEN
262 2147 262 Wawi
263 2147 263 chenkaiwen
264 2147 264 CleinCc
278 2147 278 medmdg_3
309 2147 309 -0v0-
334 2147 334 tianbincheng
338 2147 338 kringeman1
351 2147 351 Remgagagali727
370 2147 370 C0DET1GER
411 2147 410 dandelayer
426 2147 426 hardenisthegoat
459 2147 459 Jarif_Rahman
464 2147 464 wenbozh
»
7 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

ORZ, Spanish CP goats!!!!!