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

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

Hello Codeforces

After countless nights of yapping, bedfight duels, and failed zero cycles

The authors of the three best Div. 1 of all time, nifeshe, chromate00, and I, have joined forces to create the Division $$$1+2$$$ round that will break the internet: Nebius Round 2 (Codeforces Round 1088, Div. 1 + Div. 2), which will be held on Mar/28/2026 17:45 (Moscow time). This round will be combined for Division $$$1$$$ and Division $$$2$$$ and will be rated for everyone.

You will have $$$2.5$$$ hours to solve $$$8$$$ problems. Between $$$6$$$ and $$$7$$$ problems will not be split into subtasks. Also, between $$$6$$$ and $$$7$$$ problems will not be interactive, so you are recommended to read the guide to interactive problems if you have not encountered them before.

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

The scoring distribution is below.

A B C D E F G H
$$$500$$$ $$$1250$$$ $$$(1250+1000)$$$ $$$2000$$$ $$$2500$$$ $$$3000$$$ $$$3250$$$ $$$4000$$$

Now, a few words from our sponsor Nebius!

We are a Nasdaq-listed company building cloud infrastructure and hyperscale platforms for AI innovators worldwide. We support the entire AI lifecycle from training to deployment, powered by high-performance NVIDIA GPUs. Behind the platform is a global team of over 1400 people, including more than 400 engineers working at the frontier of AI, supported by a dedicated in-house AI R&D team.

We’re thrilled to invite you to enroll into our first Early Talent Program! It’s designed for students and new grads to learn, contribute to building AI infrastructure, and grow into core members of our team.

If you are interested, please fill in this form. It could be your opportunity to start your career journey at Nebius.

Apply

And last but not least about the prizes for Nebius Round 2.

We’ve got something exciting lined up for the top 15 contestants on the leaderboard. Rewards come in the form of credits for Nebius Token Factory – they can be spent on inferring AI models, eg. generating text or powering AI-driven applications or agents.

  • 🥇 1st place – equivalent of $1000
  • 🥈 2nd & 🥉 3rd places — $500 each
  • 🥇 4th–15th places — $100 each

We hope you will participate and enjoy the problems. Good luck!

UPD: the contest has been delayed by 10 minutes to allow everyone to register.

UPD2: https://mirror.codeforces.com/blog/entry/152448 editorial

Top 15:

  1. turmax
  2. tourist
  3. ksun48
  4. StarSilk
  5. littleju
  6. hos.lyric
  7. literalchild
  8. pigstd
  9. Golovanov399
  10. jeroenodb
  11. Ormlis
  12. ecnerwala
  13. potato167
  14. Kevin114514
  15. Maksim1744
  • Проголосовать: нравится
  • +180
  • Проголосовать: не нравится

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

Of course there is 6 7 joke

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

As a tester, I would like to thank the Codeforces legal team for reasons I am not allowed to disclose :)

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

As a tester I tested my first round :)

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

as someone who AKed last contest in 5 minutes, I think it's too easy for me, and to prove it to the world, I'm gonna be solving problems using ML based approaches, expected time to AK: 15 minutes, and yet I need to email mike to update my rating from previous round, because there is a bug, because of which system update rating only for >=1 placed participant's, and I got 0th

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

how on earth did nife and chromate agree to write a div together

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

As a tester, I have been banned permanently from Codeforces by nifeshe 😿

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

I hope Proof_by_QED nifeshe chromate00 are all having a good day.

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

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

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

After a long time giving a contest, hope to get +ve delta! Best of luck, everyone!

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

Failed zero cycles? Does Codeforces know MCSR ball knowledge?

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

hoping i can stomp the problems instead of being goombah stomped myself

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

Problem B of 1250?

TOO HARD....

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

Why am I expert tho :(

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

Also, between 6 and 7 problems will not be interactive, so you are recommended to read the guide to interactive problems if you have not encountered them before.

WHAAAT?

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

It's good.

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

I think this contest is to very hard

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

Hope to return my Expert, please.....

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

is this the beginning of my pupil era??

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

I hope that I will solve at least 2 problems

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

Will everyone be in the same rating table? If so, why write div1+div2 if div1 is possible?

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

Hoping for a positive change in rating..

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

"UPD: the contest has been delayed by 10 minutes to allow everyone to register." But the registration was already open for quite some time ???

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

UPD: My bedtime has been delayed by 10 minutes.

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

Ready with coffee, contest delayed 10 min

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

Guys, why all the problems are on the same topic — arrays, subarrays and permutations? The only problem on a different topic is a problem E.

Question to the coordinator of this round — shouldn't the round be balanced and contain problems on different topics? It's very boring when all the problems are about good and bad subarrays and permutations.

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

    Not to be overly sarcastic, but asking "Why are all the problems about arrays?" feels akin to saying "Why do all the problems have numbers in them?" or "Why do all the problems have input and output?" Arrays (and subarrays, and to a slightly lesser degree permutations) are a fundamental concept in computing, to the point that problems in the vast majority of competitive programming topics are often best framed as problems about arrays. Indeed, I'd e.g. characterize D as a problem about bitwise operations, F as a counting problem, H as a casework/data structures problem, etc.

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

      Steelman: Compare these problems with the problems of, say, the recent ICPC North America Championship. Just vibe-wise, they look very different! And indeed I would argue that the problems of the latter seem more diverse. That is not to say they are better, of course.

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

Mathforces

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

A and D are good but B and C2 is more like Guessforces also sample test very weak both B and C.

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

Oh hell naww, I will drop back to newbie after this contest ;((. At least, I will become the newbie with the most contribution on codeforces! (lol)

By the way, I love how CF's admins reacted in this contest; in just 30 seconds after Pa8ITER345's AC on H, Pa8ITER345 got banned.

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

I'm cry on C2....

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

Cucked by $$$C2$$$

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

What's wrong with my solution to C1? I thought the last k elements' ordering doesn't matter, but the for first n-k, a[i] = b[i] (unless b[i] = -1). 368564987

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

The problems are cool <3 but why is E way harder than F 😭😭

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

D is a very good problem! but How can I solve C2?

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

    I used data structures to solve C1, but encountered issues when applying them to C2

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

    When a window of size k is shifted towards right, index i -> i+1 and i+k-1 -> i+k. This implies two things: either both a[i] and a[i+k] are same or if they aren't same then a[i]=b[i] and a[i+k]=b[i+k]. Following this you check for each index i (0<=i<k) which category this group of indices fall into. Then you check if ith index is of type 1 then all elements at indices i+k, i+2k, ... in array b should also have that same value or (for 2nd case) then the elements at the corresponding indices should be same. Since it can have multiple elements , do not forget to keep a count of the elements positive. If it goes below 0 at any time print NO immediately . You can check out my submission here: https://mirror.codeforces.com/contest/2211/submission/368587191

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

gimme d3 or i'll retire

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

F Too simple.

G Just randomly guess some sufficient/necessary conditions.

AI shitted the contest. Bad round.

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

    You don't understand how hard I tried to make G harder without making it ugly and failed every time

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

    Yes, Problem F was clearly easier than Problem E. I think F was more like a template problem. It didn’t require much technical skill; you basically just had to copy the problem statement verbatim.

    What do you mean by “AI shitted the contest. Bad round.”? Did the AI actually solve this 3000-point problem? That’s unbelievable.

    Quick question: Was the data set not very challenging, which is why my memory-based search optimization using an unordered_map actually passed?

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

bro the brainrot in b...

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

~~~~~~~~~~~~~~~~~~ void solve(){ int n;cin>>n;

for(int x = n; x; --x){
    cin>>a[x];
    int k;cin>>k;
    int fate = 0;
    vi offers;
    offer[x] = {};
    int lcx = 1;
    for(int i=0;i<k;++i){

       int y;cin>>y;

       for(int oy: offer[y]){
         int v = __gcd(oy, a[x]);
         v /= __gcd(v,lcx);
         if(v==1) continue;
         lcx = gcd(lcx * v, a[x]);
         offer[x].PB(v);
       }

       fate += dp[y];

    }

    if(offer[x].empty()){
       dp[x] = fate + 1;
       offer[x] = {a[x]};
    }else dp[x] = fate;


    cout<<dp[x]<<endl<<flush;

}

} ~~~~~~~~~~~~~~~~~

why does it says memory limit exceeded for this code(problem E), isn't 60 * N sufficient

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

I was surprised to see my name appear in G's sample

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

Why does the E grade solutions in 5++ minutes????

If it graded them earlier, I could try using the LCM of the set

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

My first and second submission on C1 are wrong answer in pretest 1 (sample). I already check it locally and it gives me the correct output but somehow it gives different output on codeforces. I then submit basically the same solution in python for my third submission and it passed all the pretests. Does anybody know why this happened?

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

E is hard to figure out a simple solution. F is rather too simple?

Nice round to me anyway.

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

Is E just storing keys as coprime basis? Had this idea right after it ended :sob:

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

#include <bits/stdc++.h> using namespace std; int T,x,y; int cnt(int x) { int t=0; for(int i=1; i<=sqrt(x); i++) if(x%i==0)t++; if(sqrt(x)*sqrt(x)==x)return 2*t-1; return 2*t; } int main() { cin>>T; for(int i=1; i<=T; i++) { cin>>x>>y; int p=abs(x-y); if(p==0)cout<<1<<'\n'; else cout<<cnt(p)<<'\n'; for(int i=1; i<=x; i++)cout<<1<<' '; for(int i=1; i<=y; i++)cout<<-1<<' '; cout<<'\n'; } return 0; }

This is my code to Problem B. Who can tell me why I Wa on test 2? Thank you so much.

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

Seems E misleads quite a some participants into storing primes/coprimes/keys with deletion, including me. How come can you guys come up with LCM?

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

    I stored kind of prime basis of gcd's with all of it's children's prime basis. In order to tradeoff between size of basis and time to factorize a number , I tried storing primes till 1e6 and then a big number but it was not under the TL. Tried 1e5, 1e4, 1e3 and finally submitted on 1e4.

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

    I only realised it after the contest, but for me the idea was.

    For each node $$$u$$$ you have a set of primes $$$S_u$$$ which gives the optimal output for that subtree. If $$$P_u$$$ are the prime factors of node $$$u$$$, then you can compute $$$S$$$ as follows,

    $$$T_u = \bigcup_{v \mid v\text{ child of }u} (P_u \cap S_v).$$$

    Then, if $T_u$ is non-empty $$$S_u = T_u$$$, $$$S_u = P_u$$$ otherwise.

    Now think of each set as a frequency table, the above recurrence is equivalent to $$$\max_v(\min(P_u, S_v))$$$.

    Now instead of making $$$P_u[p] = 1$$$ if $$$p$$$ divides $$$a_u$$$ and $$$0$$$ otherwise, make $$$P_u[p]$$$ be the number of times $$$p$$$ divides $$$a_u$$$. This obviously doesn't affect us since we just want to know if the value is $$$0$$$ or not.

    Now just note that if you look at the prime factorisation, LCM is equivalent to $$$\max$$$ and GCD is equivalent to $$$\min$$$.

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

    I am storing coprimes. Log^2 is more like tiny number squared in this case.

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

Please upload the editorial.

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

Bonus: what if $$$\displaystyle{f(a)_k=\sum_{1\le i_1 \lt i_2 \lt \ldots\ \lt i_k\le n} a_{i_1}a_{i_2}\ldots a_{i_k}}$$$ in problem D?

Spoiler

BTW I didn't solve D during the contest.

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

I got baited by 676767677 in the problem B, I thought the answer would never reach that high, so my approach is wrong cause why else would they mention it. Never thought I'd get rekt by 67.

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

I submitted this code on 2h 24 min, it passed the pretest after 2h 30min, is this submission legal?

Why can't it be sys tested?

https://mirror.codeforces.com/contest/2211/submission/368593258

upd : Tt is solved. Thanks to Proof_by_QED.

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

The proof for B is just brilliant!

I wasn't able to make my intuition in-contest rigorous, but I'm not even mad because of how elegant the argument is.

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

is the system testing done? there was a message that it's rescheduled for another round of system tetsing!

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

https://mirror.codeforces.com/contest/2211/submission/368524210

another day another cheater. even his B submission is LLMish. kindly review it please

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

The A problem Really easy for me, Or maybe the one who created make a flaw?. My logic only if n >= 2 then output 2,

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

at least solved 2 problems

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

Hello,

I would like to clarify the plagiarism warning for my submission.

I mistakenly participated in the contest using two accounts. Both submissions were written by me, which is why they appear very similar. I understand now that using multiple accounts in the same contest is against the rules.

There was no intention to copy from others or gain unfair advantage, but I realize this is still a violation. I sincerely apologize for this mistake. I will use only one account for all future contests and follow the rules strictly.

Thank you for your understanding.

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

Subject:Appeal for submission 368581194 for problem 2211C1 My submission ID 368581194 is lower than 368584326, proving I submitted first and did not use anyones code The algorithm similarity exists because this problem has only one intuitive approach, confirmed by the official editorial verify the overlapping window with a frequency map. Any independent solver arrives at this exact structure. Our coding styles are clearly different: I used bits/stdc++.h, long long, no IO optimization, map named cnt, and YES outside the if-else. Sridhar_M used separate headers, int, ios_base::sync_with_stdio, map named available_counts, YES inside each branch. I solved this independently, drawing on practice from similar problems like CF 1553E. My past submissions are consistent with this coding style. I have never violated Codeforces rules and request a fair review of the timestamps and code differences. please reconsider my case codeforces team

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

Subject: Appeal for Submission 368536297 (Problem 2211C1)Dear Codeforces Team,My solution for 2211C1 was flagged for similarity with user -zura-. I would like to provide evidence that my work is original:Time Advantage: My submission (18:09:14) was made 25 minutes earlier than the other user's (18:34:34). It is logically impossible for me to have copied their code.Mathematical Necessity: For the Easy Version, since $$$a$$$ is a permutation, the sliding window constraint $$$b_i = b_{i+k}$$$ combined with the permutation property forces $$$b_i = a_i$$$ for all $$$i \le n-k$$$ and $$$i \ge k+1$$$. This is the standard mathematical derivation for this problem, which naturally leads to the identical if conditions in most implementations.Implementation Differences: My code uses #define int long long and a standard vis array, while the other user uses a heavy template with custom macros (vi, vp, etc.) and fast I/O optimization. Our coding habits are entirely different.Given that I submitted much earlier and the problem logic is highly restrictive, the similarity is a coincidental result of reaching the same optimal mathematical conclusion. Please reconsider my case.Best regards,

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

I wrote this solution independently during the contest and did not copy or share code with anyone. I used my usual personal template that I had before the contest. If needed, I can provide editor history / timestamps to show that the code was written by me.

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

Hello Codeforces Team,

I received a notification stating that my solution for problem 2211C1 (submission ID: 368591160) significantly coincides with another participant’s solution. I would like to clarify that I wrote my solution independently during the contest.

My method is based on a simple observation about the constraints of the problem particularly taking advantage of the fact that array a is a permutation. An obvious and common solution is to fix elements outside of a specific range and validate the middle segment using a presence check. As a result it is possible that several participants came up with very similar implementations.

I should also add that I had previously practiced similar problems and studied Codeforces blogs so I was familiar with this type of approach. Although my solution's structure might have been impacted by this earlier exposure, I didn't copy any code during the competition.

I did not share my code with anyone, nor did I use any public IDEs or platforms that could have exposed my solution unintentionally.

If needed, I am happy to explain my approach in detail or provide further clarification.

Thank you !

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

I would like to raise a concern regarding my recent contest being flagged for the solution 2211F.

I want to clearly state that I did not cheat. I used a straightforward combinatorics-based intuition along with a recursive approach to count values. Even though I wasn’t sure if it was the intended solution, I implemented the idea that came naturally to me during the contest.

I understand that in such problems, many participants can arrive at similar logic and structure independently. My solution was written entirely on my own.

I kindly request the admins to review my submission again. You can also compare it with my past accepted submissions, as my coding style and structure have been consistent across contests.

Thank you for your time and consideration.

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

    by seeing your profile I can say atleast one thing, you are doing great, I will just tell one thing, forget about this just do questions, as I am saying because of lots of cheaters, it is very difficult to know who is cheater and who is not but one thing I can for sure, it does not matter until or unless you are enjoying problem solving, so happy coding

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

The cheaters still received a rating increase, I hope the ratings will be rolled back and recalculated soon.