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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

SAMSOOM ALL THE WAY

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

Here we go again with 6-7 meme.

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

Did he just say 6-7??

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

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

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

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.

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

sixxseven meme geting old

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

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

not the 67 joke :sob:

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

67 mentioned!!!!

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

Hope to reach my highest rating ever before.

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

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

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

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?

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

What do you mean by "Nobel Peace Prize"?

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

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.

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

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

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

very nice this round

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

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

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

The score distribution has not been released yet.

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

Is div 2 rated?

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

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

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

Nobel Peace Prize ha ha

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

This one was good contest actually.

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

As a participant, Good luck everyone!

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

Excited after reading the first comment.

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

The difficulty level suddenly increased after D1.

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

least unbalanced div2

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

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.

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

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?

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

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

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

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

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

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

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

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

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

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

      How so?

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

        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)

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

          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?

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

            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

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

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

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

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

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

Idk about you, but this is VERY sus:

crimson_leaf's solves for this round

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

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

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

This div 2 round was comparatively easier.

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

Guys can anyone tell me how you solve E?

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

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

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

    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)

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

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

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

i fucked up

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

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?

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

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

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

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.

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

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.

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

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.

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

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

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

Div 2 E is fire

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

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

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

358297716

Spoiler

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

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

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

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

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

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

intresting contest!I like it.

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

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.

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

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.

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

    which ide do you use to validate sample test cases?

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

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

      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

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

    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.

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

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

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

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

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

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

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

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

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

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.

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

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.

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

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.

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

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.