_O_v_O_'s blog

By _O_v_O_, 3 weeks ago, In English

你好,Codeforces!

We are excited to invite you to participate in Codeforces Round 1129 (Div. 2), which will be held on Oct/24/2026 14:05 (Moscow time). Note the unusual start time of the round.

You will be given 2 hours and 15 minutes to solve 6 problems. One of the problems will be divided into 2 subtasks. At least one problem will be interactive so we recommend reading the guide to interactive problems if you have not encountered them before. All the problems were authored and prepared by Getaway_Car and me, _O_v_O_.

We'd like to express our sincere gratitude to:

Good Luck & Have Fun! We hope you enjoy this round!

UPD1: Scoring distribution:

$$$500 - 750 - 1500 - (2000 + 2250) - 2750 - 3000$$$

UPD2: Congratulations to the winners (subject to change):

Official:

  1. nike0g
  2. TasselFlower
  3. binglengmo
  4. legendcn
  5. lenohoo

Unofficial:

  1. peti1234
  2. nike0g
  3. TasselFlower
  4. binglengmo
  5. __baozii__

First solves:

A: 00:01:49 by ZeeroBug
B: 00:05:03 by Dipanjali_4184
C: 00:10:14 by wangyizhi
D1: 00:21:41 by TasselFlower
D2: 00:27:57 by TasselFlower
E: 00:41:25 by evenvalue
F: 00:27:55 by jiazhichen844

Editorial

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

»
3 weeks ago, hide # |
 
Vote: I like it +46 Vote: I do not like it

as a writer, i authored

»
3 weeks ago, hide # |
 
Vote: I like it +59 Vote: I do not like it

As a tester, I was red when I test :(

»
3 weeks ago, hide # |
 
Vote: I like it +18 Vote: I do not like it

As a tester, god I love interactive

»
3 weeks ago, hide # |
 
Vote: I like it +20 Vote: I do not like it

hope everything goes smoothly

»
3 weeks ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Wow cnoi round again

»
3 weeks ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

Love the 19:05 start time, hope to see more rounds scheduled at this time :)

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good start time for CN participants

»
3 weeks ago, hide # |
 
Vote: I like it +24 Vote: I do not like it

As a tester, I miss interactive xD

»
3 weeks ago, hide # |
 
Vote: I like it +19 Vote: I do not like it

Nice round and enjoy

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Nice Time!!!

»
3 weeks ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Great time for Vietnamese participants :D although it overlaps with atcoder but I will participate

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

beautiful handle, beautiful time, beautiful round!

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Holy, employed and samsoom in one round, negative 100 points is calling lol

»
3 weeks ago, hide # |
 
Vote: I like it +19 Vote: I do not like it

As a Tester, I think this is a great CNOI round!

»
3 weeks ago, hide # |
← Rev. 2  
Vote: I like it +6 Vote: I do not like it

The time is perfect, I like it

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As a cucu, caca

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Note the unusual start time of the round.

finally, a contest that starts early instead of starting late!

»
3 weeks ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

As a participant, my goal is to solve three problems. Good luck to everyone!

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

Hope to reach lgm

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

YESSSSSSS

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

OvO

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

спасибо вам за раунд)

»
3 weeks ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

As a tester, orz _O_v_O_

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to register?

»
3 weeks ago, hide # |
 
Vote: I like it -78 Vote: I do not like it

tourist Whoever sees this comment is gay. (except cry , Camal and evanchen )

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

zcCN!!! Wish I can solve 4~5 problems and get high rating.

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

hopefully i'll not begin the contest with chopsticks in my hand

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Will Codeforces Round 1129 (Div. 2) be rated for newcomers

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

hopefully i'll be pupil by this :))

»
3 weeks ago, hide # |
 
Vote: I like it -14 Vote: I do not like it

As a monkey on a typewriter, pokloopp;p00 scdajtc3w023c23[0c23-c also good luck guys girls others prefer not to says and monkeys ok I'm gonna go write hamlet io3439v3ojkltoer

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

_O_v_O_ pls make it on usual time bcs your contest overlaps with Atcoder

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As a competitor,I am (unrated) when I compete

»
3 weeks ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

I love you.

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good luck guys, dont cheat

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

hi

»
3 weeks ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Perfect start time. My sleep time comes back.

»
3 weeks ago, hide # |
 
Vote: I like it -14 Vote: I do not like it

as a tester, i am excited about it sto orz

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As a Chinese contestant, it's the most wonderful start time I've seen. Perhaps it's the first rated contest I will participate on Codeforces. Good luck!

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

may be a up vote

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

19:05?! not 22:35?! I like the start time! don't have to stay up late

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As a Contestant , Getaway_Car &‌ _O_v_O_ orzzz !

»
3 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As a contestant , i hope that this starting time will help me get green profile name

»
2 weeks ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

As a tester,the problems are interesting.

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

The time is perfect, I like it!

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

sto zhuchenyao orz

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

thanks for the song in question A

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

pro ovo. SUPPORT

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

So little participants, everyone went to do ABC

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

The gap between Problem D1 and D2 is too huge :sob

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

how to solve D2, do we need to find some Pattern in the values of f(n) ??

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

    Here is my code:

    1   #include <bits/stdc++.h>
      1
      2 using namespace std;
      3
      4 long long D[61] = {0, 0, 1, 3, 5, 7, 11, 17, 21, 29, 33, 41, 53, 61, 75, 91, 105, 115, 133, 147, 171, 187, 211, 233, 249, 271, 289, 327, 353, 379, 409, 427, 46    3, 493, 527, 555, 611, 645, 677, 717, 749, 785, 823, 869, 913, 951, 999, 1033, 1081, 1153, 1197, 1235, 1293, 1343, 1401, 1451, 1497, 1551, 1609, 1679, 1731};
      5 long long P[61] = {0, 1, 6, 24, 76, 220, 606, 1612, 4158, 10482, 25866, 62692, 149526, 351716, 817362, 1879520, 4282058, 9676688, 21710796, 48400096, 107283238    , 236583310, 519300176, 136820651, 474962826, 371105961, 616376335, 49951329, 863257431, 526934377, 189831495, 723584179, 289527242, 562262698, 696690249, 7474    39775, 622443848, 338894318, 543542652, 181080058, 269836323, 799645219, 13719665, 631195792, 37230596, 744717670, 86874645, 866645875, 132641236, 75253961, 80    1733003, 975460330, 826925938, 668089391, 890807927, 948390927, 345304740, 812267539, 331051740, 990929756, 485065574};
      6
      7 long long sumationShit(long long num) {
      8         if (num < 1) {
      9                 return 0;
     10         }
     11         int m = 0;
     12         while ((1LL << m) &mdash; 1 < num) {
     13                 m++;
     14         }
     15
     16         long long lo = 1LL << (m &mdash; 1);
     17         long long hi = (1LL << m) &mdash; 1;
     18         long long cut = hi &mdash; D[m];
     19
     20         long long ans = P[m &mdash; 1];
     21         long long c1 = min(num, cut &mdash; 1) &mdash; lo + 1;
     22         if (c1 > 0) {
     23                 ans += c1 % 998244353 * m + sumationShit(c1 + 1) &mdash; sumationShit(1);
     24         }
     25
     26         if (num >= cut) {
     27                 long long c2 = num &mdash; cut + 1;
     28                 ans += c2 * m + (D[m] + hi &mdash; num) * c2 / 2;
     29         }
     30
     31         return ans % 998244353;
     32 }
     33
     34
     35 int main() {
     36         ios::sync_with_stdio(false);
     37         cin.tie(nullptr);
     38
     39         int t;
     40         cin >> t;
     41         while (t--) {
     42                 long long l, r;
     43                 cin >> l >> r;
     44                 long long lAns, rAns;
     45                 long long ans;
     46
     47                 lAns = sumationShit(l &mdash; 1);
     48                 rAns = sumationShit(r);
     49
     50                 ans = rAns &mdash; lAns;
     51                 ans = (ans % 998244353 + 998244353) % 998244353;
     52
     53                 cout << ans << "\n";
     54
     55         }
     56
     57         return 0;
     58 }
    

    The main idea is that a num can be computes as either doing op1 until the highest bit is set and then deleting until you get the correct bits or just adding the bits one by one (you can add bit k, by doing op 1 k times and then doing op 1 again, this will put k and only k as 1) the main idea here is that:

    doing it the first way takes m + d (m times op 1, d times op 2) second way is m + f(n — 2^(m-1)), (you can think of this as just putting that bit there and then doing the rest of the bits, which I defined recursively)

    if you put these together than deleting is cheaper when d <= f(r),

    then effectively we can precompute the amount of numbers for each range of [2^k, 2^(k+1)) that will be cheaper to do in the first way, and that will be cheaper to do in the second way.

    then you compute for each for each bit block the total cost.

    tbh reading my explanation it makes it way more complex than it really is, I suggest you play around with the bit values of the numbers on paper, the core idea is kinda obvious once you get the hang of it, and the rest is just algebraic bullshitery.

    oh and the numbers that are cheaper to delete are all part of a suffix, so you essentially use prefix sums for that, same for low and high, its all prefix sums.

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

time was cool so were the problems

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

1/ I lost my brain when solving A
2/ How tf to solve D and E???? TT
3/ So many cheaters....

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

    Hints for E:

    • Root the tree at node 1. We'll perform two phases.
    • In the first phase, use $$$(n - 1)$$$ queries to determine the subtree size of every non-root node $$$u$$$.
    • For the second phase, make the following observation: if you sort the nodes of a rooted tree in decreasing order of subtree size, then the parent of every node lies strictly before it in this order. Try to build the tree one edge at a time by going across nodes in this order (when you encounter a node, try to find its parent from the preceding nodes), and using the same idea as in the first phase.
  • »
    »
    2 weeks ago, hide # ^ |
    ← Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    B and A shoulve been switched tbh.

    D2 is pretty simple at its core (at least for the amount of points you woulve gotten from it), i did a small explenation for aditya. But holy shit the amount of off my one errors drove me nuts lol.

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

..

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

    The process of checking whether a subsequence is good does not affect the original array

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

    Choose $$$b = [2, 1, 1, 0, 3]$$$

    There is already an element 0, therefore, after any operations, there is at least one zero left in $$$b$$$, therefore, the original subsequence is already good.

»
2 weeks ago, hide # |
← Rev. 2  
Vote: I like it -19 Vote: I do not like it

Deleted

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

    Did you not feel anything like shame while writing this comment? Or does the very 80 IQ that compels you to cheat (I doubt you could even solve 2C on your own) also make it impossible for you to harbour complex human emotions like guilt and shame?

    • »
      »
      »
      2 weeks ago, hide # ^ |
      ← Rev. 2  
      Vote: I like it -12 Vote: I do not like it

      Deleted

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

        why does the reply feels ai generated

        • »
          »
          »
          »
          »
          2 weeks ago, hide # ^ |
           
          Vote: I like it -9 Vote: I do not like it

          If u don't understand basic english what can I do, english is taught as a compulsory subject from school in my country.

          Anyways, after getting this much hate i cant think of commenting again. Hoping future days will be better without my comments as i am most hated guy in comments (whenevr i post something got too downvotes :sob)

          Still, wish you all the best and hope you crush your next contests!

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

    you are everything that is wrong with todays codeforces, you want everyone to think you are so smart for solving these when in reality you are just using ai even you comments seem ai writen go kys you ai trash

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

How to solve D1?I tried either deleting (2^msb) — 1 then recurse on the remaining or get to (2^msb+1) -1 then deleted to the goal and choose the best value, it worked but for larger values it caused overflow any help?

  • »
    »
    2 weeks ago, hide # ^ |
    ← Rev. 3  
    Vote: I like it 0 Vote: I do not like it

    Just a intuitive idea, I think it might be using digit dp, or there might be some observations.

    Btw, the problem ask you to modulo 998244353, overflowing shouldn't be a problem

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

      My solution was ok, I just did 1<<n instead of 1LL<<n -_-! I want to jump off the window rn

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

Bruh back in the day solving a,b quickly would get you to 1500. now im losing 45 rating

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good problems

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good contest but tf am I doing, if I could've actually implemented I would've easily gotten AC, please help how not to spend 20 minutes making a simple helper function

  • »
    »
    2 weeks ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it
    it's way easier to implement than what you've done
»
2 weeks ago, hide # |
← Rev. 4  
Vote: I like it 0 Vote: I do not like it

I believe I will reach 1200 rating after this round, though I didn't do A and B fast enough...

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

any idea ? how to improve in contests ?

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What to do in D2?

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why did this submission 395859622 get skipped after the contest? I submitted the same code again 3 minutes later 395860335, and both got AC during the contest. The only difference is that I commented out #define int long long in the second one, since I know it can cause issues with LCA. But only the second one stayed accepted.

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good contest.

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What is wrong in this code for Problem B


// #include<bits/stdc++.h> using namespace std; void solve () { int n; cin >> n; vector<int> a(n); for (auto &num: a){ cin >> num; if (num == 0) {cout << n << endl; return ;} } vector<int> pref1(n,1), pref2(n, 1); for (int i = 1; i < n; i ++) if (a[i] <=a[i - 1]) pref1[i] += pref1[i - 1]; for (int i = n - 2; i >= 0; i --) if (a[i] <= a[i + 1]) pref2[i] += pref2[i + 1]; int ans = 0; for (int i = 0; i < n; i ++) { int val = pref1[i] + pref2[i] - 1; if (val > a[i]) ans = max (ans,n - a[i]); } cout << ans << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t --) solve (); return 0; }
»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why the timings were so odd, i was thinking it is at 20:05 :( ?

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

150+ solve on D2 but it's hard to find a single legit participant among those...

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

My solution discussion stream for ABCD1E

»
2 weeks ago, hide # |
 
Vote: I like it -12 Vote: I do not like it

So the Dipanjali_4184 is the fastest to solve problem B, after solving problem A all in the span of 5 minutes and proceeds to solve nothing more, while his entire last round got skipped. Yeah looks like a fair participant and deserves to be mentioned in the announcement.

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As a first time contestant, and although it is late to say this, orzzz to everyone who helped in this and everyone who participated.

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

1129 div2 will always be special for me. Finally reached pupil.

»
2 weeks ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

This was such a good contest man, really enjoyed it!!

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

IN Problem B

5

2 1 1 0 3

why answer is 5?

Thanks

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

    the answer always is either zero or n because if you can make one element equal to zero after that you just need to remove every other element so you end up with one zero , and in this case you already have a zero so you can just remove other elements

»
2 weeks ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

As a tester, I miss interactive

»
2 weeks ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

as a writer, i authored

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

Hello Codeforces Team,

I am writing to respectfully request a review of the similarity warning regarding my submission 395869936(https://codeforces.me/contest/2277/submission/395869936) for problem 2277F, which was flagged as significantly similar to submission 395853784(https://codeforces.me/contest/2277/submission/395853784).

My Codeforces account, rating, and reputation are important to me. I have been actively participating on Codeforces for approximately 50 days, and my submission history is available for review. As a Pupil-rated contestant, I am working consistently to improve my programming skills.

I respectfully request a manual review of both submissions, particularly the specific matching portions and their implementation details, before any decision affecting my account or rating is made.

I am willing to cooperate fully and provide any genuine information that may help clarify the situation. I would appreciate a fair assessment based on the relevant evidence and circumstances.

Thank you for your time and consideration.

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

Hello Codeforces Team, I am writing this again,

with sincere respect to request a careful manual review of the similarity warning issued for my submission 395869936(https://codeforces.me/contest/2277/submission/395869936) for problem 2277F, which was flagged as significantly similar to submission 395853784(https://codeforces.me/contest/2277/submission/395853784).

I want to clarify my position and respectfully ask that my submission not be judged solely on the similarity warning without examining the full circumstances. My Codeforces account, rating, and reputation mean a great deal to me, and I take competitive programming and fair participation seriously.

I have been actively participating on Codeforces for approximately 50 days, and my submission history is available for review. I am a Pupil-rated contestant working consistently to improve my programming skills. I understand that account history alone cannot establish what happened in this particular submission, but I hope it can provide useful context.

I respectfully request that the two submissions be examined side by side, including the exact matching code sections, implementation details, and submission timelines. If there is a specific concern beyond the similarity itself, I would appreciate the opportunity to understand it and provide a factual explanation.

I am ready to cooperate fully and provide any genuine records or information that may help clarify the situation. I sincerely request a fair and evidence-based assessment before any decision affecting my account or rating is made.

Thank you for taking the time to review my request.