Hello, Codeforces!
We are excited to invite you to participate in Codeforces Round 1120 (Div. 1) and Codeforces Round 1120 (Div. 2) on Sep/12/2026 17:35 (Moscow time).
The round will be rated for participants from both divisions. You will be given 6 problems and 3 hours to solve them. At least one of the problems will be divided into subtasks.
The problems were authored and prepared by me, CutSandstone, and sukon.
We would like to thank:
- abc864197532 for being the coordinator.
- Um_nik for preliminary reviewing the round.
- Alexdat2000 for translating the statements to Russian.
- baluteshih, dlu, kevinyu, MattTheNub, n685, nadya271, yunz_qiao, _istil, alvingogo, avnithv, awoo, BurnedChicken, Fysty, Misuki, passwordisa, pbj2006, snowythecat, WiwiHo, and YuukiS for testing the round and providing valuable feedback.
- KAN and MikeMirzayanov for the great Codeforces and Polygon platforms.
- And finally,
You
, for participating!
The scoring distribution is:
- Div. 1: $$$(500 + 1000)$$$ — $$$1750$$$ — $$$1750$$$ — $$$2500$$$ — $$$3000$$$ — $$$3250$$$
- Div. 2: $$$500$$$ — $$$1000$$$ — $$$(750 + 1250)$$$ — $$$2250$$$ — $$$2250$$$ — $$$3000$$$
We hope you enjoy the problems.
Good luck and have fun!
UPD:
Congratulations to the winners (subject to change):
Div. 1:
Div. 2 (trusted participants):
UPD 2:








Auto comment: topic has been updated by kondasujay2 (previous revision, new revision, compare).
As a setter, kondasujay2 is the goat
As a participant, I haven't seen a Div.2 D of 2250 recently.
Hope not to get negative delta.
True... :(
Hope not in this one.
As a setter, sukon is the goat
Yeah
As a tester, I think the problems are decent!
div1!!!
D and E are same scores that means the contest is hard
It means that E is easier than usual lol
My bad T-T
why?
Hopefully, the problem statement will be as short and precise as the announcement
I hope that there're more interesting data structures. I have been tormented by freshness and math problems for a long time.
As a participant, I hope i can reach specialist
Oh... you will
orz streak!!
update: got a -13
Thanks everyone for participating in Codeforces Round 1120 (Div. 1, Div. 2). Although it was initially difficult to understand from the editorial when I first participating in Codeforces contests. However I found that once I got used to it, the explanations felt very easy to understand, accurate, and highly academic.
We should read the hint and solution before reading code (Sorry for my bad English)
As of the time of this comment, the contest has not yet happened nor has the editorial been publicly released. Are you a time traveler ?
It was just a piece of preliminary advice. He never said there was an editorial.
As a participant I can’t wait for all the jiangly block decomposition problems
hope can become a pupil in this round :>
Thanks for organizing the round.... looking forward to the problems. Good luck everyone, and most importantly.... have fun.
orz
3 hr and 6 problem combo is scaring me...
+1
Three hours!? Mom doesn’t have to worry about me failing to solve the problems anymore
this is very tuff
program.cpp:3:139: error: invalid digit "9" in octal constant 3 | We are excited to invite you to participate in Codeforces Round (Div. 1) and Codeforces Round (Div. 2) on Saturday, September 12, 2026 at 09:35UTC-5. | ^~ program.cpp:20:2: error: extended character — is not valid in an identifier 20 | — 1750 | ^ program.cpp:21:2: error: extended character — is not valid in an identifier 21 | — 1750 | ^ program.cpp:22:2: error: extended character — is not valid in an identifier 22 | — 2500 | ^ program.cpp:23:2: error: extended character — is not valid in an identifier 23 | — 3000 | ^ program.cpp:24:2: error: extended character — is not valid in an identifier 24 | — 3250 | ^ program.cpp:26:2: error: extended character — is not valid in an identifier 26 | — 1000 | ^ program.cpp:27:2: error: extended character — is not valid in an identifier 27 | — (750+1250) | ^ program.cpp:28:2: error: extended character — is not valid in an identifier 28 | — 2250 | ^ program.cpp:29:2: error: extended character — is not valid in an identifier 29 | — 2250 | ^ program.cpp:30:2: error: extended character — is not valid in an identifier 30 | — 3000 | ^ program.cpp:1:1: error: 'Hello' does not name a type 1 | Hello, Codeforces! | ^~~~~ Command exited with non-zero status 1
i am a super man,let me see your strenth!
This will be my first contest. excited for it !
orz yunz_qiao!
I am 100% sure I am gonna regret participating in this contest.
I mean the Score distribution is a HUGE fucking RED flag... Whenever there is C1 & C2 in Div2. and a D with 2250 score. Things never ended well.
I totally agree rounds with subtasks are trash and unbalanced. And scoring other problems also show this round will be awful round
bro had a vision
I hope I will be specialist after this round good luck to everyone
I wish yall good luck
let me introduce you best cheaters ever, from div1 contest. and so many cheaters there.
someone of them got skipped during the contest lol
how div2 cheaters
From Div2 cheaters
Why is hardiknarang2509 not a cheeeeater?
soorry I am blind.
can anyone explain me the concept of hack please? :<
You make an adversarial test case that you think another contestant's code might give the wrong answer, take too much time, or use too much memory under the constraints of the problem. If the system tests it and you are correct, you get some points and everybody's submissions gets reran with your test case, losing all points for that problem if theirs fails.
ohhhh tysmmm!! i finally got the concept of hacks
My best contest so far! Thanks for this one.
cool problems :-)
$$$C2$$$ will give me nightmares for days...
FarmerJohn
Was stuck on C1 and figured sol 10 minutes before the end and got TLE on 6-7 tests :)
Good contest tho
B was harder for me compared to easy version of C.
A-C1 solution sketches (I got cooked)
A. It's just count of 0s or 1s
B. Only the 2*n-1 minimum elements can end up in the set and there will be at least n so check if k is in that range if it is put 2*n-k of the minimum n on the diagonal the rest on the left and shove the remaining elements wherever
C1. Similar to 2259E - Treasure Map Destruction (Constructive Version) "ban" elements that can't exist and use the rest
wait, someone actually thought C1 was similar to the nik_exist E? (no way, me too!)
couldn't do C no matter how much I tried, used a set to keep track of gaps between alternate mex but failed, waiting for tutorial, let's see what the approach is.
Honestly, this was a really frustrating contest.
B was way too time-consuming for a Div. 2 problem. It felt unnecessarily long and tedious rather than challenging in a meaningful way.
And C2 was simply far too hard. The jump in difficulty was ridiculous, especially compared to the rest of the contest. It felt less like a reasonable progression and more like a massive wall that you were expected to somehow get through.
Overall, I really disliked the problemset. B wasted way too much time, while C2 was excessively difficult. This was not a fun contest experience at all.
I do not think B was that long or tedious
I agree, but sometimes I have spent an hour on B and still got rekt pretty hard. Yes, today's B was a time sink because you had to come up with a valid construction. But I was able to quickly get it outta the way in 20 mins.
Yeah, the solution idea was pretty easy, but the implementation was a bit time-consuming.
I agree, but sometimes I have spent an hour+ on B and still got rekt pretty hard. Yes, today's B was a time sink because you had to come up with a valid construction. But I was able to quickly get it outta the way in 20 mins.
4yrs of competitive-programming,
And my dumb-ASS recollecting what tf is
|f(A)|— How do you calculate absolute value of an arrayB felt tougher than C1. No wonder, it rewards more points
spent 30 minutes making a lazy segtree for C2 because I forgor where I stored the template.
You don't need a lazy segtree
You don't need a segtree either
c2 was extremely difficult imo
yeah, still don't know how.
c2 was unfairly hard for its difficulty and ill die on that hill
Why heavy DS D I feel like the main observation could have been preserved woulda been a fine D, but instead its a hard D pause
actully I didnt like the contest a lot B and A were cool C1 score was very low . it was less than B . that is really bad :( C2 dp was nightmare . I would like to have more dp problems in contests but not like this level in C2. D was cool .
is there hacking phase in this contest? or not?
It's usually only there after div3 or div 2 educational
so why they have mentioned it in question C, Though i have seen many people got their C1 AC through O(n^2) approach.
There was in-round hacking enabled. basically you were assigned rooms , and you could look and hack solutions of anyone in your room. Div2's are usually tight enough that hacking is not needed (Atleast in my opinion), but there is no hacking after the round is over
also can youshow me the solution that is $$$O(n^2)$$$ ?
I realised that this is n sqare and resubmitted the difference array one. That is the reason I got -93 in this contest. But turns out, I could have used this very solution and would have gotten a way better rank
It is not $$$O(n^2)$$$.
The constraints say that a solution could exists which means the input is special.
it is not possible for any arbitrary input to result in a possible set.
so it is constrained $$$a[i] \le \frac{n}{i}$$$
what about the testcase when all the values are 0? Like:
1 1e6 0 0 0 0 ...This is $$$O(n^2)$$$ because there are $$$\sum_{i=1}^n i$$$ operations for this code
I don't think $$$a[i]\leq\frac{n}{i}$$$ does anything to that.
Amazing contest! C1 was WAY tougher than B though
beautiful D1B D1C but imo D1A2 is pretty awful
Kind of agreed with D1A2 but tourist somehow got it 2 minutes after D1A1, maybe it's just awful because we're bad.
Will there be any hacking phase for this round?
Boring problems, whenever i come to do some contest for fun it's very annoying to see the endless variations of MEX or XOR problems. Literally nobody cares. Find something more creative. TopCoder had more interesting problems than this.
Problems are way too numerical about some patterns that no one on earth would care about. Who cares if you have some array A and you do some transformations to it what the end result is.
A is ok
B is good, some thinking to do.
And then that's it pretty much who the hell cares about MEX.
I would say C1 didn't have too much difficult involvement with mex and stuff, I just thought that there were bins where there and to be an element and some where there shouldn't be any
Yeah MEX problems suck: C1 was literally just compute which ranges of values needed to be excluded, and once you crossed out all the values from 0 -> n — 1 that don't work. You are left with all the values that do work.
editorial when?
I think the test cases for Problem C1 (Div. 2) are weak.
It got accepted, but should give a TLE.
The test cases for this problem are really weak. I found this $$$O(N^2)$$$ brute-force solution that got AC smoothly. It seems the worst-case scenario (an empty set where $$$a_i = 0$$$ for all $$$i$$$) was completely missing from the tests.
Submission: https://codeforces.me/contest/2263/submission/390480145
But how can it exist for n >= 1 and non empty B? No matter what you pick, at i = n, 0 will always be present in the array, making the MEX > 0
Yeah, Still N^2 should fail somewhere even if 1 is present. Anyway they updated ratings, without any hacking phase.
I think there can be this test case where the provided array is simply (n-1) / i + 1 for each i.
"Your task is to construct any ( possibly empty ) subset B"
Also non-empty B in test case
Thought I would become a specialist after this round lmao. These div 1 + div 2 contests are so annoying outcome wise
Good for you :), I love it when people find smart ways to get the AC.
I had to use a lazy segment tree lol. Nowadays, even pupils need to know seg tree to hold that nice green title.
I mean honestly you must realize that since the array itself is static you dont need the update functionality of a segtree so you can use a difference array. Like marking a range is fundamentally a difference array but updates make it slow.
Is there going to be a hacking phase for this round?
Fun little contest, thx for the rating boost, but I mean it was like:
A: 800 — 900 B: 1000 — 1100 C1: 1300, maybe 1400, because I had to use Seg Tree to quickly tell me which ranges of values needed to be excluded C2: 1700+, I read it and it seemed kinda cooked, like I don't know how to wrap my head around all the conditions that had to be satisifed -- and how to count the number of ways to satisfy all constraints.
D: 2000+, read it and realized that your favorite pupil had never seen this kind of bullshit before.
E, F: ???
Actually you could use difference array.
or merge interval kinda shit
E: The graph is a functional graph. One of the necessary conditions for it to be good is that there's at most one value with in degree 0. All values that are suffix maximums send to 0 so you can use at most 2 suffix maximums, let them be x and y. Clearly one of them must be the greatest value in the array.
Let's say we start the path with value v. Then the next value must be either x — v or y — v depending on where the value is in the array. Let's say wlog it is x — v, then the next value must be x — (x — v) or y — (x — v). Actually it can't be x — (x — v) because that's exactly v and you end in a 2-cycle (unless it's the end of the path), so it must be y — x + v.
Now, after every 2 operations you add y — x to the value. So if you split the path into odd and even indices, the subsequence with the same parity is a arithmetic progression where you add y — x.
Let's find the ratio by using a well known bruteforce-ish trick: If a[1] and a[2] are in the same subsequence then a[2] — a[1] is the absolute value of the ratio. Otherwise, they belong in different subsequences and a[3] must belong to the same subsequence of one of them, so you can just test a[3]-a[1] and a[3]-a[2]. Test every candidate for the ratio.
Now having the ratio fixed we know that one subsequence must contain a[N] and the other must contain a[1], which lets us find what are the subsequences. Test to see if the values are the same as the input. If it's not, then clearly this isn't a good ration, if it is then the question is whether we can find a way to distribute them in a way the path exists and if we can how many times we can do it. Now I'll leave the proof of the rest for someone else because I'm tired but we can prove the path needs to end with 0 sending to the maximum value so the subsequences are (in reverse order) A[N], A[N] — r, ... and 0, r, 2r, ...
The second maximum must be the last element of the array and elements of the same subsequence must be in the same "pocket" with the correct maximum. Any permutation of the elements in the correct pockets are good. If N is odd then the subsequence with A[N] has the extra element.
Anybody notice that there is system testing running right now after the ratings are updated ?
incosistent difficulty round and turtle speed editorial
This was the first Div2 where I solved 2 problems; I'm very happy with the improvement!
I feel dumb now realizing I massively overcomplicated my failed attempt at D1B/D2D
You can go through the sequence backwards. I wonder if anyone has an online decremental solution?
So weird that the problem is so easy when seen backwards.
Auto comment: topic has been updated by kondasujay2 (previous revision, new revision, compare).
Auto comment: topic has been updated by kondasujay2 (previous revision, new revision, compare).
Why the system testing is still going on?(Do we expect more changes in ratings and rankings??)
first time got rank under 10k still got hit with negative delta :)
Some of the standings for div 2 seem so suspicious. For eg — the rank 2 guy apparently has never made a wrong submission in his life and is now Master after this contest.
wasn't able to solve C, tried quite hard :)
Let me introduce you some VIP cheaters from Div2
Raising a concern:
In that match, I was playing normally and never used any AI tools to answer this question. I heard that my code was the same as another player's, so I'd like to ask if you even checked that player's work. Besides, I noticed that this person's code for other questions has a very high AI usage rate, while I haven't used AI at all. I did use other auxiliary tools, but everything was done manually. Please review this again.
Translate by bing
Plagiarism warning appeal — C2 Floor of MEX
Handle: sharma2806 Submission: 390468709 Problem: 2263C2 Hi, I received a plagiarism warning for my submission 390468709 for C2 — Floor of MEX.
I want to clarify that I did not copy code from, share code with, or communicate with the other users mentioned in the warning. I do not know these users.
My approach was based on the following reasoning. For each k, if the required MEX is m, then every quotient value from 0 to m-1 must occur, while quotient m must not occur. Since floor(y/k)=q corresponds to an interval [q*k, (q+1)*k-1], I converted the problem into two types of interval conditions:
some intervals must contain at least one selected value; some intervals must contain no selected value.
I used a difference array to mark the forbidden intervals, because this is a standard range-marking technique. For the required intervals, I stored the strongest left boundary needed for each right endpoint. Then I processed positions from left to right. My dp[i] represented the number of valid sets whose last selected position was i, and ways stored the total number of currently valid states. When the required left boundary moved forward, I removed DP states whose last selected position was too far left. I also handled the empty set separately when the first positive requirement appeared.
I understand why the checker found similarities. After comparing the codes, I can see that another submission uses the same interval transformation and a very similar DP implementation. However, if applicable, I arrived at this formulation independently and did not obtain their source code.
There are also implementation differences. My code directly maintains the active forbidden count during the final sweep using blocked += diff[i], while one of the other submissions first constructs a separate boolean forbidden array. I use a moving pointer remove with while remove < limit, whereas that submission removes states using a threshold update and an explicit for loop. My variable organization and final sweep were written independently
Request for manual review — Round 1120 plagiarism warnings
Handle: sharma2806
I received similarity warnings for:
C1 — submission 390460523 C2 — submission 390468709
I would like to request a manual review.
For C1, my approach was straightforward from the condition of the problem. For each k, if a[k-1] = m, then the values in the interval
[m*k, (m+1)*k — 1]
cannot belong to the required set. I therefore marked these forbidden intervals using a standard difference array. After taking the prefix sum, every position with coverage 0 is allowed.
Because this solution consists almost entirely of the standard difference-array pattern
diff[l] += 1, diff[r+1] -= 1,
followed by one prefix-sum sweep, I understand that independently written solutions can look very similar. After comparing the matched C1 submission, I can see that both codes use this same natural structure. My implementation uses different variable organization and also constructs and outputs the resulting list of valid values, but I am not claiming that these superficial differences alone make the codes unrelated.
For C2, I extended the same interval interpretation. For a required MEX m, quotient values 0..m-1 must occur and quotient m must not occur. Since floor(y/k)=q corresponds to [q*k, (q+1)*k-1], I converted the conditions into required and forbidden intervals. I then used a difference array for forbidden ranges and a DP over the last selected position for the required intervals.
I did not copy code from or communicate with the matched users. I understand why the checker detected similarity, especially because the same interval interpretation leads to similar implementations, and I am requesting a manual review of the submissions.
If any additional information is required, please let me know.
Thank you.
Additional context: Before this round, I had studied the editorial/solution pattern from the recent Round 1119 Div. 3 problem. That problem also teaches the idea of converting conditions into restricted intervals, marking those intervals with a difference array, and then processing the resulting constraints with a sweep.
Because I learned that implementation pattern from the earlier editorial, I naturally approached C1/C2 using the same style of interval transformation and difference-array processing. The official Round 1120 editorial itself also notes that the C1/C2 solutions are very similar to the recent Div. 3 E.
This may explain why parts of my implementation resemble other solutions that used the same recent technique. For C2, I then extended that interval idea with a counting DP over valid states.
I am not saying that every line of the C2 solution comes from the earlier editorial; I am only explaining that the earlier public editorial strongly influenced the way I learned to implement this type of interval problem, so independently written solutions based on that same pattern can look structurally similar.
Round 1119 editorial: https://codeforces.me/blog/entry/156457 Round 1120 editorial: https://codeforces.me/blog/entry/156688
I received a similarity warning for submission 390463650 for problem 2263C2. I wrote this solution independently during the contest and did not copy or share my code with other participants. I still have my original implementation and can explain the algorithm and implementation in detail if required. I would appreciate it if the similarity could be reviewed.
Hi, I received the plagiarism warning for my submission 390452983. I solved the problem myself and did not copy the code from the other submissions. I understand that my implementation is very similar, especially the difference array and prefix sum parts, which may have triggered the detector. I did not intentionally use or view another participant's solution during the contest. I just wanted to clarify this. Thank you.
Attention! Your solution 390439909 for the problem 2263B significantly coincides with solutions Satvik29/390439909, hunny_chhillar_22. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code).
I wrote the code myself and also i submitted the problem before, i dont know how the problem was similar to the other person . I did not intentionally use or view another participant's solution during the contest and i just wanted to clarify this. Thank you.
also i dont know that user and does't have any connection with him
Hello Codeforces Administration Team,
I am writing regarding the similarity warning for my submission "390479018" for problem "2263E".
I noticed that the notification lists "mjalan98/390479018" among the coinciding solutions. "mjalan98" is my own Codeforces handle, and "390479018" is the submission in question. Therefore, I believe there may be some confusion in how the similarity results are being displayed.
I would respectfully request a manual review of my submission against the other participant's submission, "PychanXD/390475769".
I solved the problem independently and did not copy or share my solution with another participant. I would be happy to provide any explanation or evidence that may help with the review.
I respect the Codeforces rules and understand the purpose of the plagiarism detection system. I would greatly appreciate it if the case could be manually reviewed before any penalty is imposed.
Thank you for your time and consideration.
Regards, Codeforces handle: mjalan98
i have recieve a plagiarism warning for submission 390459573 for problem 2263b because it they says it matches with my solution 390442135. i have wrote my solution myself and did not view or copy that users submission . the problem has a very has some observable constructive solutoin, and my implementation is what i did myself. i want a manual review of the two submissions and the whatever the detection they have thought. You can check my history and my code style. It was not very difficult to see that the solution is only possible when k>=n && k < n*n.. Even the sample cases explais this.
Me and my friend have decided to give a contest as a team but the contest allowed only individual participants, but we have to practice the coordination for ICPC, so we sat together and gave the contest together, I admit that we used same code but due to unawarness of rules we have committed this mistake.
I am assuring the whole coding community that this won't be repeat in future. Thanks for Understanding
Hello Codeforces Team,
I received a similarity warning for my submission [390464547] on problem C1 ("Floor of MEX").
This is my own solution, written independently during the contest. The logic I used is very standard for interval exclusion problems:
1.Based on the MEX property, any element (y) in the range ([a_k . k, (a_k + 1) . k — 1]) is forbidden from being in the subset (B).
2.I used a standard difference array (mark) to exclude these invalid intervals for all (k).Finally, I collected all indices where the overlap count is 0 into the answer array (B).
Since using a difference array/prefix sum is the most straightforward (O(n)) approach for this observation, my implementation structurally aligns with others who solved it analytically. Please review my case.
Thank you.
Hello,
I received a plagiarism notification for my submission 390483116 for problem 2263D — Culling Game, stating that it significantly coincides with submission 390451998 by LingXy. Honestly I don't weather it is right place to write this issue about. I would like to clarify that I do not know this user and did not copy or exchange code with them.
For the Fenwick Tree implementation used in my solution, I referred to a publicly available cp template from this repository:
https://github.com/CODE-ESI-CLUB/Competitive-Programming-101/blob/5cc5642a3abe1de165bda5a35eb8d21b955b4bfa/Intermediate/Algorithms.md
The repository contains the standard Fenwick Tree implementation with the same operations: update add, prefix sum, and range sum using idx += idx & (-idx) and idx -= idx & (-idx). This source was publicly available well before Codeforces Round 1120 on September 12, 2026.
My implementation is not an exact copy of that code like I changed the types, function names, and implementation style but I used it as the reference for the standard Fenwick Tree structure.
I believe the detected similarity may therefore be due to both submissions using this common and publicly available Fenwick Tree implementation.
My submission: https://codeforces.me/contest/2263/submission/390483116
Could you please review the plagiarism decision again? kondasujay2
Thanks team.
Hello,
I'm writing about the plagiarism-coincidence notice for submission 390484754 on problem 2263C2 (Floor of MEX, Hard Version).
On my process: I wrote and debugged this solution entirely on my own in VS Code, using the CPH (Competitive Programming Helper) extension to run it against the sample test cases given before submitting through Codeforces directly. I've never posted this code anywhere public no ideone, pastebin, GitHub, or messaging platforms and had no contact with the other flagged user before, during, or after the round.
I'd also like to point out some context that I think supports this being an independent coincidence:
I regularly read through editorials as part of my practice, and I recall reading the tutorial for 2259E "Treasure Map Destruction (Constructive Version)" from Codeforces Round 1119 (Div. 3) before this round: https://codeforces.me/blog/entry/156457. That editorial walks through exactly this technique, marking forbidden ranges with a difference array, then a prefix sum to find the remaining allowed positions which is the first stage of my own solution. This round's own editorial notes that the C1/C2 approach is very similar to that recent Div3 E, so I believe this is why my solution converged toward this shape.
In this round's editorial comments, multiple other solvers independently describe arriving at essentially the same core idea on their own. That suggests the algorithm itself is a fairly natural, convergent one for this problem, not something unique to a small handful of submissions.
Given this, I'd really appreciate it if the coordinators could take a closer look at the actual implementation details across the flagged submissions. Please let me know if there's anything else I can provide.
I would greatly appreciate your consideration, as this may affect my rating.
kondasujay2
Thanks for your time.