Hello, Codeforces!

We are excited and pleased to announce that Codeforces Round 1102 (Div. 2) will be held on Jun/07/2026 17:35 (Moscow time). This round will be rated for all participants with rating below $$$2100$$$. You will be given $$$2$$$ hours and $$$15$$$ minutes to solve $$$6$$$ problems, including one split into two subtasks (not necessarily placed adjacently).
All problems were authored and prepared by Fakewave, FairyWinx and me.
We would like to express our special thanks to:
- FairyWinx for awesome coordination;
- 300iq, k1r1t0, _istil, Wansur, and __baozii__ for red testing.
- _Crimson_, Ansori, and Arpa for orange testing.
- VitaliiV, sanya37y, and pattern-seeker for purple testing.
- pokysayou, eyfxrby, katya_prints, AK_15, Morselllprimo, and alex_step for blue testing.
- nik_exists, s97b, opa, AbramovAndrey, furt1ve, and Re06741math for cyan testing.
- ak1ko, Everes, and re06769 for green testing.
- bibiq, Yanemilashkarr, and re067 for gray testing.
- MikeMirzayanov and KAN for the great platforms Codeforces and Polygon.
- And last but not least, You for participating!
The score distribution is below.
| A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|
| $$$500$$$ | $$$750$$$ | $$$1250$$$ | $$$1750$$$ | $$$2500$$$ | $$$1750$$$ | $$$3250$$$ |
GLHF!
UPD: Editorial!








as a tester, I am happy to have tested my (hopefully final) round listed as a cyan tester
as a tester, i was testing from another account(not a twink or fake or cake)
Fakewave orz!
as a tester, i was a tester
looking forward to solve till C!
gl!
can you allow participating with unrated :)
FairyWinx isn't added as an author in the contest page
What the hell i up with that scoring
C and F are different versions of one problem
O that's an amazing news.
xd technically this can be interpreted as a tester leak, since it wasn't public information which problem F was a supertask of
(doesn't really matter though since we'll know as soon as we open the contest, but still kinda funny)
The fact seems to be obvious. I would give the same explanation if I wasn't a tester
The point isn't that F is a supertask (which I agree is obvious). The point is that F is a supertask of C. As a non-tester, I have no idea which problem F is a supertask of. In particular, this commenter (https://codeforces.me/blog/entry/154239?#comment-1369544) guessed that F is a supertask of D (and I probably would have made the same guess). Now we have the extra information that this isn't the case.
what does it really matter?
nothing, which is why i find it funny rather than problematic
most things people comment on this site don't matter
Explaining what pattern-seeker meant post-factum not to spam "spoilers" before the contest, just like it could be deduced from the score distribution that F is a supertask, it also could be seen that as the total score for F (with its subtask) should be between $$$2500$$$ and $$$3250$$$, assuming increasing order of scores, the only possible subtask for it is C. (Okay, it could be B, the total score would be exactly $$$2500$$$, but having two identical scores for problems is rare ig)
i don't think it's that rare lmao, even just looking at recent rounds
in that sense, it is neither guaranteed that B+F > D nor D+F <= G; subtask score distribution is weird and in general i don't read too much into it wrt difficulty
but anyways i was mostly just joking, don't worry about it :)
Hope i hit specialist this contest
nevermind
C humbled me very fast☠️.
nice pic bro!
Cute cat
F's score < E's score, seems interesting
It can be interpreted that F is the hard version of D
Possibly C, since it is quite rare that easy and hard versions would have same points.
BYE BYE XVIII
I think version F of the problem is harder than D.
Hope to become pupil in this one :)
Looking forward to reach pupil
At first they said there were 6 problems, I was happy, but then I saw that there were 7 problems,
Cute cat
And somehow nik_exists is still cyan…
Why is E worth 2500 but F reduced to 1750
because F is a hard version of C , but the reason why after E either the idea hard to come up or the solution is not based on C
"Me before contest: 'Today I cook.' Me after Problem C: 'Today I am cooked.'"
Cute cat!
As a first-time tester—thanks to Fakewave for the opportunity, I can tell this contest is going to be absolute cinema. And spoiler alert: you don’t need any ping-pong skills to solve these problems!
Nice profile pic
thanks, your profile picture is cool too !
67
Author: 6 problems. My brain: 2 opportunities.
oo ee aa cat , nice
This cat is literally me getting Wrong answer on pretest 2 after struggling with Problem for 1.5 hours.
Hello
Hi
67?
how to contest plss
Long Time , No Interactive Problem :(
As a tester, I love bananas
i like and join the contest for mr.pushycat :)
Good luck to all participants!
It is my first match. I'm so excited!
lets test
atleast the cat is cute
gray testing?? what do they test? the punctuation of the statements?!
Any one,Can i know how score distribution related to problem rating....
the score distribution only tells how much the problem is worth in the contest, it is of course based on the difficulty the setters think the problems have
the rating for the problems will be calculated later, based on who managed to solve the problem during the contest
so there is no direct relation between both of them, but both should follow the difficulty of the problem
Beba approves.
Hope to become Candidate Master, please!
good luck!
im interested
looking forward to choke again
hoping too cross 1800 for the first time !!!
bro i see you on the subreddit omg omg big fan
Wish me Luck
Really hope I can pick C up today. :)
I think 60–70% of today's contestants are cat lovers.
67% to be exact
Looking to solve A today :)
I've seen that cat explode
I was excited for this event. That is very clean chit helpful for my work experience.
score of
F= 1750makes me curious like a cati solved A number question.it was tricky and easy question.i would like to thankfull to the person who set this problem..
How I get such a bad rank even after solving upto $$$D$$$. Feels depressing man :(
problem B is fun!
The problem statements are very confusing to me, not gonna lie...
why is this giving WA? 377670333
It overflows. You should use 0LL for accumulate instead of 0
ans[i]=accumulate(w.begin(),w.end(),0LL);oh! thanks man
The framing of language for problem A was very confusing.
solved till B, and TLE/WA on C. I used wrong types (int instead of long long) in some tries. probably my while loop on C so i'll try upsolving it later
I completed the implementation for $$$F$$$ right after the contest finished :(
it was a great contest!
the issue was that I started the second DFS in my code from $$$n - 1$$$ and not $$$0$$$ :(
I know i have a skill issue but damn i wasted more time understanding what i was asked to output than to actually solve. But still, good contest ( really curious about how to solve F )!
segment tree
Prefix and suffix max
unrelated but i love ur pfp
It might just be me, but I thought the story about the vessels at the top of C/F made it much harder to understand the question because it made me picture something different than what was asked in the formal statement
As a femboy, I do not get why the ordering was not C1C2 considering how easy F was in comparison to D!
D was easy no?
G is a very cool problem <3
Thank you! This is my favorite problem among the ones I have set so far :3
Very good job! You should be proud <3
Feedback:
Well, author solutions in F — ~30 lines)
That doesn't mean everyones solution will be short. Still an implementation-hell problem.
E would be beautiful if I didn't WA8 even though it seems like I had the right idea rip
(I also spent way too long on the dead end trying to turn it into a DAG)
F the impl was fairly straightforward I feel like. Just unroll the array and then solve prefix/suffix with stack (I guess you do have to be careful)
Totally agree. I was doing VP on this round, and I came up with solution for F in 15 minutes, but took like 2 hours to implement. Granted I am getting rusty but there are too many details in F.
I disagree on C/F. That was a really elegant and intuitive problem that was fun to solve, especially the hard version. Perfect for division 2.
Problem F does require a bit more implementation effort, but why shouldn't it, when it's a programming competition, not a mind-solving competition. Translating ideas into code efficiently is part of the challenge. If you struggle with that, that's an area where you need to improve.
Personally I much prefer implementation challenges over mathforces where the solution is just
return x * 42;except you need a math degree to prove it's correct.Peeking at the solution you submitted (377700470) I notice that you significantly over-complicated the solution. There is absolutely no need for lazy-updated segment trees here; a simple stack suffices. I'm not surprised it took a lot of effort to implement all of that, but that was because you failed to conceive of a simpler solution, not because the problem was intrinsically hard to implement.
Over 1000 contestants managed to solve Problem F. This was totally unimaginable in past contests.
Auto comment: topic has been updated by FairyWinx (previous revision, new revision, compare).
D was a confidence booster for me, as I always aimed to solve ABCD in div2. although I feel it was of difficulty of div2C and only u needed to understand that only three numbers can be formed due to beautiful property of exor
How does one write a problem which everybody dislikes
so i herd u liek mudkipz
My ID is not visible in official standing though I can see it in unofficial standing. I did not opt for out of competition. This is my first contest could someone guide me please? Will I get a rating?
You must have got the rating by now.
at least the dog is kinda cute
G nice SGT prob :)
any tips for how to improve?
Got into competitive programming around last yr, and started with USACO. Hit gold but couldn't do more than 3 competitions,so since Codeforces competitions happen more often im looking to pursue them for fun.
today was my first competition and the problem style is kinda different. how do u guys practice?
Nice round!
Especially the insightful problem G
the problem was pretty nice .. thank you problem setters
nice E and G
can anyone tell me why only three numbers are possible for in problem D i found it out by brute force testing but not able to figure it out why if someone has reasons for it happy to hear and meanwhile this is my impl for brute force testing
https://codeforces.me/contest/2234/submission/377750216
do we gonna have a tutorial for this round?
This contest was very good and luckly, i got +121 rating points which resulted me level up to expert.
But i'd like to talk to authors and testers in problem C(and F). Who wrote legend? Why is so hard to understand (in russian)? There is no logic, its like it could transfer water to the right, but he can transfer water to left, but he cant?! My friends are so upset and lost rating points and they also solved D and E problems, skipping problem C. How did problem creator wrote this legend and testers didnt notice?
does anyone help me out with my code for problem F [submission:377759541]
Here is the similar O(n * n) approach which is passing the easy version[submission:377765080]
I was getting wrong answer on testcase 2 line 2038
It would be very helpful for me, Thank You.
The bug was instead of cnt++ it should be cnt += prevCount[i — cnt] + 1 and same for nextCount
Corrected Code: [submission:377769815]
nice E
Is the tutorial even coming
i am waiting for it lol
Appeal Regarding False Positive Plagiarism Detection on Problem 2234D
Hello Codeforces Team and Community,
I received a system message flagging my solution 377673698 for problem Codeforces Round 1102 (Div. 2) due to a significant coincidence with user Insomania14's solution (377674947).
I am writing this to clarify that this is a false positive. My solution was written entirely independently during the round. The coincidence is purely due to two factors: the use of a standard, publicly available template, and the highly deterministic mathematical nature of the problem itself.
Per the Codeforces rules regarding third-party code, I would like to present my evidence below.
1.Compliance with the Third-Party Code Rule (GitHub Template)
My submission uses an advanced competitive programming template for boilerplate setup (including debugging macros dbg(...), fast I/O optimization, and container overloads). This template is publicly available on GitHub and was published long before the start of this round.
Template Source: https://github.com/ncduy0303/Competitive-Programming
As per the updated rules, using distributed pre-written code is completely permissible since it was published before the contest, and the actual problem-solving logic within the template was written entirely by me.
2. Structural & Stylistic Evidence of Independent Implementation
While the underlying mathematical formulas match because the problem has a unique mathematical approach, a side-by-side comparison of our implementations reveals completely different coding styles, structures, and choices.
Code Layout: My code (prashant_1901) uses modularized logic isolated inside a solve() function, while their code (Insomania14) uses flattened logic placed entirely inside the main() function.
String Naming: My code uses uppercase names (A, B), whereas their code uses lowercase names (a, b).
Conclusion
These absolute differences in style, variable naming, I/O handling, and structural architecture show that two completely different minds implemented this logic independently. The identical conditional branches (if (k % 2 == 1)) are a direct consequence of the problem's mathematical constraints and cannot be written any other way. I kindly request the coordination team to review these structural realities and restore my submission. Thank you for your time and for keeping the platform fair.
Best regards,
prashant_1901
Appeal Regarding False Positive Plagiarism Detection on Problem 2234B
Hello Codeforces Team and Community,
I received a system message flagging my solution for problem:2234B due to a significant coincidence with user sdazzleberry's solution. I am writing this to clarify that this is a false positive, my solution 377633185 was written entirely independently during the round, and the overlap is a direct consequence of the problem's mathematical rigidity leaving essentially one viable implementation path.
A pattern that I had studied prior to the contest is from: https://codeforces.me/blog/entry/95488 Digit DP tricks by gnudgnaoh, published 5 years back. The blog is publicly indexed on Codeforces, authored years before the contest, and directly explains why any two programmers who read it and solved this problem would independently arrive at the same bool vis[][][] + bool dp[][][] global pattern with memset(vis, 0, sizeof(vis)) inside the test case loop.
The problem requires finding the largest palindrome $$$a \le n$$$ such that $$$(n - a) \bmod 12 = 0$$$. The only tractable approach within the time limit is to iterate over candidate palindrome lengths $$$L$$$ from largest to smallest, and for each length, run a tight digit DP over only the first $$$H = (L+1)/2$$$ digits since the remaining digits are mirror-determined. The mod-12 contribution of each half-position $$$i$$$ is mathematically fixed as $$$(10^i + 10^{(L-1-i)}) \bmod 12$$$ for symmetric positions and $$$10^i \bmod 12$$$ for the middle, giving the formula w[i]=(i=j) ? p10[i] :((p10[i]+p10[j])mod 12), an expression which has no equivalent alternative. Any independent solver who arrives at this approach will write this exact line. Because of the algorithm, the DP state space (position, remainder_mod_12, tight_flag) and the weight precomputation are all uniquely forced by the problem constraints, two independent authors will inevitably produce code that looks structurally identical in the core logic.
Despite this, a careful side-by-side comparison does reveal independent authorship in the surrounding code. This is evident in the boolean flag used to track whether a valid answer was found: my code names it $$$\texttt{ok}$$$, while sdazzleberry's code names it $$$\texttt{fine}$$$, a small but genuine divergence that reflects two different minds choosing their own natural word for the same concept. Beyond that, my code uses compressed, minimal indentation with loop bodies occasionally sharing lines with their braces, while sdazzleberry's code applies uniform 4-space indentation throughout. The global variable declarations, the use of $$$\texttt{'\ n'}$$$ for output, and the recursive structure of $$$\texttt{f()}$$$ are all standard competitive programming conventions that any learning coder would independently adopt, their presence in both solutions is no more suspicious than two people both using $$$\texttt{int\ main()}$$$.
I respectfully ask the coordination team to weigh the mathematical necessity argument seriously, which has caused the structure to collapse to essentially a single implementation. Similarity is therefore inevitable and should not be treated as evidence of collaboration. I kindly request a review and restoration of my submission. Thank you for your time and for keeping the platform fair.
Best regards,
Regards,
1r1s
Regarding Violations for Codeforces 1102 Round (Div.2) Codeforces Round 531 (Div. 3)
2234D - XOR, Expression and Two Binary Numbers:- my solution 377645621 is quite different from almost everyone's flagged along with me (pay attention to the logical AND check in the for loop unlike others). i only found it logically similar to 1r1s 377658973, but our variable naming, function definition is very different! It is a small straightforward solution without much scope of uniqueness.
2234E - Vlad, Misha and Two Arrays:- my solution 377684520 has a standard procedure for the given question- binary exponentiation, dfs and function declarations for permutation and main functions, I do not know the other people, my variable declarations and template- everything is different from others, the core logic was quite straightforward for someone who has knowledge of trees and bit manipulation.
2234F - Vessels, Heights and Two Versions (Hard Version)-My approach starts from the observation that the maximum height in the circular array is unique in the sense that it dominates every other value. To avoid dealing with circular wraparound directly, I rotate the array so that the global maximum becomes the cut point and work on the remaining n-1 elements as a linear sequence. For each position in this sequence, I need aggregate information about maximum values contributed by segments extending to the left and to the right. I compute these using a standard monotonic decreasing stack with block compression. While processing an element, smaller or equal values are merged into the current block, and a running sum cur is maintained by removing the contributions of merged blocks and adding the contribution of the new maximum. This allows me to compute all left-side contributions (pref) and right-side contributions (suff) in linear time. Finally, for each original position, the answer is obtained by combining its left and right contributions and mapping the index back to the original circular order. The easy/brute-force solution (2234C - Vessels, Heights and Two Versions (Easy Version)) explicitly computes, for every empty position, the maximum seen in both directions around the circle. The hard solution uses the observation that after cutting the circle at the global maximum, these directional maxima become sums of subarray maxima in a linear array, which can be computed for all positions simultaneously using a monotonic stack in O(n). please notice the different variable naming and template followed by me.
I have never been flagged earlier and i have given a contest after a good amount of time after practicing a lot of problems online for upcoming interviews.
please consider my request as genuine, chichii
I received a plagiarism warning for 2234A and 2234B. I want to clarify that I developed my solutions independently and did not share my code with anyone during the contest. I believe someone may have copied my solution without my knowledge. I did not use any public platforms to share my code. I dont even know who 0x00_nullptr is. I request the admins to please review this fairly.
Appeal Regarding False Positive Plagiarism Detection
I am writing to appeal the plagiarism flag on my submission 377658973 for 2234D - XOR, Expression and Two Binary Numbers and 377673384 for 2234F - Vessels, Heights and Two Versions (Hard Version).
2234D - XOR, Expression and Two Binary Numbers:
i have been flagged for similarity with submissions of other users. zscoder's Non-trivial DP Tricks and Techniques (codeforces.com/blog/entry/47764, published 2022) teaches enumerating all combinations of binary state pairs as DP states, reading this directly led me to ask what all joint states of position i across both strings could be, yielding the four cases (0,0), (0,1), (1,0), (1,1) stored as p, q, r, s rather than collapsing them into three counters as the flagged solutions do. The same blog's emphasis on tracking full state combinations, not just marginal counts, is precisely why my solution computes cross-products u = p*r + q*s, v = p*q + r*s, w = p*s + q*r, a formulation that is a direct mechanical consequence of the 4-bucket decomposition the blog teaches, and one that appears in none of the flagged submissions in any form.
My solution uses a fundamentally different algorithmic decomposition from all flagged submissions. I classify each position into all four possible (c[i], d[i]) bit-pair combinations, storing counts in four separate variables p, q, r, s, a 4-way split that none of the other solutions use. G_Moranya, Beevee, kunalc, and poorvansh all reduce the problem to three counters (xA/xB/xC, cx/cy/cz), tracking ones in each string and differing positions independently. My approach of tracking (0,0), (0,1), (1,0), (1,1) frequencies separately and then forming cross-products u = p*r + q*s, v = p*q + r*s, w = p*s + q*r is a distinct mathematical route, none of these intermediate variables appear in any other flagged submission in any form.
Additionally, the bound computation in my code, z = 1LL<<(b+1), then m = (z+2)/3 and n = (z+4)/3 for even b, and m = n = (z+2)/3 for odd b is a derivation that appears in none of the other solutions. G_Moranya and Beevee compute total_elements = (1LL << k) + 1 then P = total_elements / 3, incrementing cntA and cntB for even k. kunalc uses N = (1LL << k) + 1 with the same pattern. poorvansh uses N = (1LL<<k)+1 with named flags fx, fy, fz. My z = 1LL<<(b+1) is a different base quantity altogether, (b+1) vs k and my (z+2)/3 ceiling-division formula reflects independent reasoning about the recurrence, not a rounding adjustment on a shared N/3 base that all other solutions share.
2234F - Vessels, Heights and Two Versions (Hard Version):
I arrived at my solution through the following reasoning. The problem involves a circular array, and directly handling circular structure is messy. I noticed that the tallest vessel dominates everything around it, so it serves as a natural breaking point. i used this to cut the circle there and flatten the remaining n-1 elements into a straight line, which made the problem tractable.
references:
Monotonic Stack Guide
labuladong Monotonic Stack Template
Once linearized, the answer for each position depends on what the tallest vessel is in each direction along this line. Rather than computing this naively for every position, I realized I could process the entire array in one left-to-right pass and one right-to-left pass using a stack. The stack groups consecutive elements under their running maximum, and I maintain a cumulative sum that updates in constant amortized time as elements are merged into larger blocks. Each pass fills an array of contributions, and the final answer per position is just the sum of its left and right contributions, remapped to the original circular indices.I want to be transparent about how much effort went into this. i spent a significant amount of time during the contest working through the circular structure, reasoning about the cut point, and carefully implementing and debugging the stack logic. Having that work flagged is genuinely disheartening, and I do not want hours of independent effort to be dismissed without consideration.for a long time which reflects its complexity.
I acknowledge the structural similarity to other submissions and understand why it raised a flag. However, this reasoning felt like a direct and natural path through the problem, and I reached it without referencing any other code. I have worked on my skills and given the contest after a long time and did not communicate with or view submissions from any other participant during the contest. I sincerely request that this be reconsidered.
Rating of problem C is just 1200? Bro i used sparse table to solve this one and feeling very good after solving this, but it's just 1200. Life is tough
did some people get removed from the leaderboards? my rank is higher than it was when the rating updates first came out (then 2000 now 1807), and my rating is up