nifeshe's blog

By nifeshe, 4 months ago, In English

Hello Codeforces,

After decades of hard work and several quality reviews from independent third parties, I'm delighted to invite you to participate in Codeforces Round 1073 (Div. 1), and, if you really want to, Codeforces Round 1073 (Div. 2), which will both held on Jan/17/2026 17:35 (Moscow time).

In each division, you will be given $$$7$$$ problems and $$$3$$$ hours to solve them, one of which will be divided into subtasks. Problems were mainly authored by me, nifeshe, with help from nika-skybytska and satyam343. Only $$$6$$$ or $$$7$$$ problems will not be interactive in each division, so please make sure to read the guide for interactive problems before the contest.

In related news, we’ve already been awarded the Nobel Peace Prize for this round, for achieving a level of problem quality so universally accepted that all global conflicts have been resolved.

I would like to thank the following people for making the contest possible:

The score distribution is below.

Div. 1:

A B C D E F G
$$$500$$$ $$$(750 + 750)$$$ $$$1750$$$ $$$2250$$$ $$$2750$$$ $$$3500$$$ $$$3750$$$

Div. 2:

A B C D E F G
$$$500$$$ $$$1000$$$ $$$1250$$$ $$$(1500 + 1250)$$$ $$$2750$$$ $$$3250$$$ $$$3750$$$

Unlike other rounds, this one will only be held once, so I sincerely hope you will not skip the round and enjoy all of the problems.

UPD 1 The hacks are disabled for problems A — D2 in Div 2, and for problems A — B2 in Div 1. We have final tests consisting of pretests and hacks for all problems.

UPD 2 Editorial

UPD 3

Congratulations to the winners.

Div. 1:

  1. Petr
  2. strapple
  3. jiangly
  4. tourist
  5. Radewoosh

Div. 2 (subject to change):

  1. LHNB
  2. xoxoKitty
  3. EchidnaTea
  4. AuroraUwU
  5. t1e1

First solves:

Div. 1:
A. 00:02:15 by TKT_YI
B1. 00:08:23 by Petr
B2. 00:14:54 by strapple
C. 00:35:39 by jiangly
D. 00:21:27 by PCTprobability
E. 01:42:55 by XVIII
F. 02:53:16 by olmrgcsi
G. 01:34:40 by rainboy

Div. 2 (subject to change):
A. 00:01:21 by akshW
B. 00:05:49 by khushicodes03
C. 00:10:28 by ansh91627
D1. 00:12:47 by CoderMeow
D2. 00:18:11 by sks4401
E. 00:54:52 by crimson_leaf
F. 00:47:03 by shobhitgagrani.coding33
G. 02:54:37 by dooglius

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

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

As all of you probably know, this round, being the best Div. 1 round in the history of Codeforces, and also the best Div. 2 round in the history of Codeforces, is held exactly one year after the former best Div. 2 round, Codeforces Round 997 (Div. 2)!

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

As a tester, an even better Div. 1 round will be held in two weeks.

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

As a tester, I can confirm that nifeshe stopped playing bedwars to set this round

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

    as nifeshe's former teammate, I am beyond dissatisfied with this betrayal and I demand nifeshe's return to bedwars immediately.

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

As a tester I showed the problems to all the world leaders and the problem quality was so high they mutually decided that it is now illegal to not participate in this round.

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

As a VIP tester (idek what it exactly means), div was so good I stood up and applauded mid testing

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

SAMSOOM ALL THE WAY

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

Here we go again with 6-7 meme.

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

Did he just say 6-7??

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

I'm back on Codeforces and hope to achieve good results.

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

History books in 2050: ‘GTA 6 delayed, but Codeforces secured the Nobel Peace Prize by giving 6–7 non-interactive problems in a single round.

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

sixxseven meme geting old

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

Only 6 or 7 problems will not be interactive in each division

not the 67 joke :sob:

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

67 mentioned!!!!

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

Hope to reach my highest rating ever before.

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

as a VIP tester, I solved 1e9 versions of problem D lmao

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

In related news, we’ve already been awarded the Nobel Peace Prize for this round, for achieving a level of problem quality so universally accepted that all global conflicts have been resolved.

Wow! Trump did CP?

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

What do you mean by "Nobel Peace Prize"?

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

You will be offered 6-7 problems and 3 hours to solve them.

I hope this 6 7 joke is sent to cry's basement.

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

As someone who did not provide feedback during this round, I was not forced to leave a comment on this blog. nika-skybytska ORZ!

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

very nice this round

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

as a 940 rated cp-ist, how many questions do I need to solve (or, should be able to solve, i suppose), to not completely botch my current rating

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

The score distribution has not been released yet.

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

Is div 2 rated?

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

World peace is just a O(1) solution away, unless Trump gets a Wrong Answer on Test 2.

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

Nobel Peace Prize ha ha

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

This one was good contest actually.

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

As a participant, Good luck everyone!

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

Excited after reading the first comment.

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

The difficulty level suddenly increased after D1.

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

least unbalanced div2

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

    Yes, I will partially agree with that. The round will be considered a good Div1 but yes, the rating jump after D1 or even D2 for a Div2 contestant is too much.

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

GREAT CONTEST. I just have a small suggestion that considering Div1 B1 and B2 had different solutions (though, one could have extrapolated the suffix part to the harder version as well); B2 should have more points than B1.

I know that the problem B as a whole should have <= points than C but still, it could have been managed.

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

is it only me or anyone else during the whole contest felt that they can solve E in less time compared to D2 even though E has less no of accepted submissions?

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

Good problems. 1C is solvable in $$$2n+\log(n)$$$ operations but $$$3n$$$ has easier implementation.

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

    I think it's 2n+2*(log(n)-1) because you should binary search twice. Isn't it?

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

      Yes. Thanks for pointing it out.

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

      Not necessarily, 1 binary search can be enough. In my solution (358364932) you can replace lines 96-99 with single binary search and get $$$2n + \log(n) \pm O(1)$$$ operations.

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

Wow, I'm shocked I was the only div2 to solve div2G! I guess skipping E/F helped

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

$$$D2$$$ is too hard for us Div2 peasants :(

Good problemset though, thanks for the round nifeshe and all testers.

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

    D2 is the one only one problem where you don't need to think

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

      How so?

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

        It's a direct DP problem (assuming you got D1) but I found it hard to implement (well I think there is an easier implementation that I dismissed thinking the time complexity was not good enough when in fact it was)

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

          I did solve D1, and I did think of DP for D2, but couldn't come up with the states. Could you tell me your approach for it?

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

            The approach that I initially thought of was to find the total number of RBS subsequences of a particular length in the string by using 3d DP. Like define dp[i][diff][len] as the number of subsequences of s[1...i] of length len where count['('] — count[')'] = diff (and also that there are never more ')' than '(') so you would basically get dp[i][diff][len] = dp[i-1][diff][len] + dp[i-1][diff-1][len-1] is s[i] is an open bracket and dp[i][diff][len] = dp[i-1][diff][len] + dp[i-1][diff+1][len-1] is s[i] is a closed bracket. I did some mistake in the analysis and thought this was an O(n^4) algorithm I'm pretty sure this is O(n^3))

            Now the RBS subsequences where the score is 0 are of a particular form. If the length of the subsequence is 2*p then the first p-1 positions have to be open brackets. So the number of possibilities of such "bad subsequences" is low enough for you to find all the bad sequences manually and then count how many times each of the subsequences come in s.

            For each length you can find the number of "good" subsequences and multiply it with length-2

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

this is the 3rd div1 contest in a row where problem F (D in this case) involves calculating combinations on trees

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

It was a good contest for me . C and D1 statements were vivid and that took really a lot of time but it was amazing i felt . A big thanks . Could have got a plus 100+ delta but typo and c d costed me a heck of a time . But I really enjoyed the contest.Again, Thanks a lot for rejuvenating my problem solving experience:)

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

Idk about you, but this is VERY sus:

crimson_leaf's solves for this round

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

Thank u so much authors. Tbh best div2 ever for me (although i have attended only 6 contests :D).

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

This div 2 round was comparatively easier.

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

Guys can anyone tell me how you solve E?

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

Is Div.1 D sth related to probability instead of naive calculation??

I just came up with that and it passes sample but I cannot submit!!!

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

    I did this, however one of my "ifs" was missing a print of a space, now I'm waiting systest to submit again (passed)

    Basically merge node i with n (or don't if already linked) Then I calculate all trees using the formula and multiply by the size of subtree of node i divided by the size of the merged tree (which means the probability of the component with node n-1 being attached to the subtree with node i)

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

      Same idea. Now I got accepted and realized this observation is really intuitive and could be easily proved.

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

10 seconds is all I needed to submit problem C's solution, if only I didn't forget to write the count of Zeros and Ones in the output. This round was nice

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

i fucked up

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

Why can D1B2 be solved in $$$\mathcal O(n^2)$$$ but has $$$n\le 100$$$? Why can D1C be solved in $$$2n+\mathcal O(\log n)$$$ operations but has $$$3n$$$ limit?

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

div2 with out interactive problems!! the ultimate way to test ur ability to suffer silently

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

Who on earth thought Div-2 D1 would be this simple? It feels like Codeforces contests are getting more and more unbalanced day by day, especially Div2. Years ago, an average Div-2 C was solved by around 2k people; now Div-2 D1 gets solved by over 4k+, and the last EDU div-2 problem E is solved by 2k+ during contest time. This is getting ridiculous.

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

    There are 8 problems in both divisions including subtasks so of course one would expect problems to be easier than usual for their positions?

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

      You aren't wrong, but it was a 3hrs contest (more time -> more problems)! But yeah, valid point, since Div-1 and Div-2 were separate, the problems could be easier. I should've thought about it more precisely.

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

In Div2 C, the problem statement mentions a sequence, but in the sample test case example subsequence was mentioned which i missed reading during the whole contest and tried solving the problem assuming it was a sequence. I believe this ambiguity should have been clarified explicitly in the problem statement.

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

i wouldn't able to solve any problems except from a, I give my best i think so that truly matters, would analyze the problems. Thanks for the problems they game so much motivation to solve and attend other contest as well.

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

6 7? Come on, that’s way too specific to be an accident.

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

Div 2 E is fire

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

Div 1C and Div 1E are good problems, but I have mixed feelings about Div 1D 😭😭

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

    I'd rather have that than calculating a million tiny things on subtrees.

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

    1E is just boring :( I felt ABC are good problems, D is average, E is implementation heavy.

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

358297716

Spoiler

This line in jiangly's Div. 1 C code is incredibly elegant.-

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

Thanks to the authors. Loved 2E/1C!

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

The Div.1 part of this round is so GOATED!!!!!! I love all the problems I've seen!

Also the division part of 1D is too clever for me to come up with so meowww here goes my rating

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

intresting contest!I like it.

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

I like this round a lot! I think the quality of problems are truly high, and great for me to practice.

I participated in division 1. However, I failed to solve problem C. Interactive problems are challenging for me. I need more practice.

A~B2 are quite easy, though B2 has a lot of details in dp. D needs a bit implementation and detailed analysis. C is a great problem, it is easy to solve in $$$n\log n$$$ queries, but needs more observations to solve in $$$3n$$$, which is really inspiring. I am still trying my best to learn E, which still seems reachable in my level but I didn't solve.

F and G are math problems, and they seem a bit hard to obtain for me.

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

Dear Organizers Ita a humble request that if in Alice/Bob questions, we need to worry about the cases and the checker is CASE SENSITIVE, then it should be highly emphasized. It took me an HOUR to solve C, not because of the logic, but because I didnt realize that I need to change "BOB" in one place to "Bob" for it to work. Such questions never had this condition of case sensitivity at all. And this change Really hindered my performance.

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

    which ide do you use to validate sample test cases?

    In general, these things are easily caught while validating sample test cases.

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

      To explain better what happened, I'm posting my solution method solve()

      void solve(){
          int N;
          cin>>N;
          string S;
          cin>> S;
          if(N==1){
              cout<<"Bob"<<endl;
              return;
          }
          int z=0,o=0;
          for(int i=0;i<N;i++){
              if(S[i]=='0') z++;
              else o++;
          }
          for(int i=0;i<N-1;i++){
              if(S[i]>S[i+1]) break;
              if(i==N-2){
                  cout<<"Bob"<<endl;
                  return;
              }
          }
          cout<<"Alice"<<endl;
          vi A;
          for(int i=0;i<z;i++) if(S[i]=='1') A.push_back(i+1);
          for(int i=z;i<N;i++) if(S[i]=='0') A.push_back(i+1);
          cout<<A.size()<<endl;
          P(A);
          cout<<"\n";
          return;
      }
      

      This is the one which led to correct submission

      void solve(){
          int N;
          cin>>N;
          string S;
          cin>> S;
          if(N==1){
              cout<<"BOB"<<endl;
              return;
          }
          int z=0,o=0;
          for(int i=0;i<N;i++){
              if(S[i]=='0') z++;
              else o++;
          }
          for(int i=0;i<N-1;i++){
              if(S[i]>S[i+1]) break;
              if(i==N-2){
                  cout<<"Bob"<<endl;
                  return;
              }
          }
          cout<<"Alice"<<endl;
          vi A;
          for(int i=0;i<z;i++) if(S[i]=='1') A.push_back(i+1);
          for(int i=z;i<N;i++) if(S[i]=='0') A.push_back(i+1);
          cout<<A.size()<<endl;
          P(A);
          cout<<"\n";
          return;
      }
      

      And this led to incorrect submission

      My code was designed such that in test case 1, it never prints "BOB" so thats why it passed test case 1 but not test case-2 despite the correct logic

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

    You should always assume the checker is case sensitive and you should output exactly what you're told to output in the exact format you're told. You don't need to be reminded that water is wet either. It's when checker is case insensitive that it's emphasised, what you did was insert your own assumption and demand that it's accommodated when it turned out to be wrong.

    Taken to logical extremes, your way produces statements with an insane amount of obvious things repeated ad nauseam.

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

Div 2 C could have a bit of better wording with the indices description :(

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

hoping to improve more next time!..thx for mention

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

Heartiest congratulations to the veteran Petr for securing rank 1 after such a long period of time.

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

Cry’s basement officially unlocked: all spikes jumped over successfully! Geometry Dash vibes

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

Hello, I got a plagiarism warning for my submission of 2191C. I want to clarify that I solved it independently. The approach is very common (count zeros + misplaced indices), so similarities may be coincidental. I did not copy from anyone.

Please review my case. Thank you.

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

Hello Codeforces Team,

I am writing to sincerely apologize for the coincidence flag on problem 2191C (Submission 358345061). I want to honestly admit that the solutions coincided because I was using two different accounts, both of which belong to me. The handles are this one and H_Mobin.

I did not realize that maintaining multiple accounts or submitting the same code across them was a violation of the rules. I now understand that this is wrong and undermines the platform's fairness. I have already stopped using the second account (H_Mobin) and will only use this main account moving forward.

I am very sorry for the mistake and the trouble caused. I hope you will consider my long history on the platform and allow me to continue competing fairly. Thank you.

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

Hello, I received a coincidence warning for my submission 358365826 on problem 2191C. I want to clarify that I solved this problem myself and did not copy code from any other participant. Since the solution is very short and the approach is quite straightforward, I understand that many independent submissions may end up looking similar. I respectfully request you to please review my case. Thank you.

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

Hi, I want to clarify that I solved problem 2191C completely by myself. I did not copy from anyone and I did not use any shared or public source.

I also have my handwritten notebook solution and rough work for this problem, which clearly shows my own thinking process before submitting the code. The similarity is unintentional and just a coincidence.

If needed, I can provide my notebook proof.

Thank you for your understanding.