Hello / 你好,Codeforces, ₍^. .^₎⟆
We are happy to invite you to participate in Codeforces Round 1113 (Div. 2), which will be held on Aug/01/2026 17:35 (Moscow time). This round will be rated for all participants with rating below 2100. You will be given 2 hours and 30 minutes to solve 7 problems. The tasks are authored and prepared by Zxc200611, Suwan, FISHER_ and me, szdytom.
We are extremely grateful to these wonderful people:
- satyam343 for their patient and helpful coordination.
- Alexdat2000 for translating the statements to Russian.
- Our testers: ConstructibleNumber, FetFot, liaoz123, Rvess, shorya1835, Jose_17, samsoom, AryRDW, fuad720, Pie_TealCompressorDragon, 3atori, i-love-ayase-momo, Arpa, stevvven, ALnQ417, murder_drones, SpyrosAliv, Proof_by_QED, ez_lcw, omsincoconut, A_G, _istil, chromate00, Intellegent, CSQ31, LipArcanjo, Zxx200611, MridulAhi, wuhudsm, dumb_boi, nifeshe, maomao90, avi0000, Non-origination, bitset, and gsn531.
- KAN and MikeMirzayanov for Codeforces and Polygon systems.
Score distribution: $$$500-1250-1500-1750-2500-2500-3500$$$
We sincerely hope that you will enjoy the problems!
UPD: Congratulations to the winners!
Unofficial participants:
Official participants: (subject to change)









As a tester, I can confirm that nifeshe is goated at queens, and I hope he reaches gm one day
My goat was a tester? I didn't want to participate but now I'm
As a tester, I can confirm that samsoom is the real goat.
Isn't he gm right now?
well the profile is dammed i wonder how does that feels when you only need to see the question and know the pattern and just code ... dammmed
Congratulations satyam343 on his first coordinated round!
It's not his first round. From my participation I remember, satyam343 coordinated notorious Codeforces Round 965 (Div. 2), which had serious problems with problem C and Codeforces Round 1008 (Div. 1).
However, I have another question. What's with the round setters again? Is it a back to back round set by cheaters? How does Suwan, who was a master for almost 3 years, suddenly start having consistent LGM performance?
UPD 1. Answer to the comments below who are probably just defend their friend. "He was just doing well in contests". No, not just well and I think you understand that for a master to place consistently in top10-top20 of div1 is not "just well" or "good". Even one such event is very unlikely, let alone a series of consecutive events. Now, ask yourself what are the odds.
UPD 2. Suwan removed their name (Yangfei Long) from their profile. Are they too humble to have their name on when they promptly reach LGM after being a master for 3 years?
welp here we go
I think it is unwise to label someone a cheater just because they have been performing well recently without further proof. Suwan has participated in several offline contests with good results. Plus, he had been busy with college applications and preparing for related exams before June this year. Having said that, I'm not asserting that he is or isn't cheating.
If you're still concerned however, I can tell you that Suwan and FISHER_ only helped with testcases and preparation. All ideas of the problems in this round came from Zxc200611, satyam343 and me.
Bro take this advice from me: fuck the standings and Elo; just look at yourself and take care of being a better CPer than yesterday. If you ban a cheater today, 10 will join tomorrow
There were no issues with problem C in that round
I have beaten LGMs in round before. Is it sus? Absolutely. But offline contests prove a lot (would be stronger if we could see the actual conttests and placings) and we should presume innocence until guilt is proven.
Also coordinators aren't cheating so why the animosity toward them? The round is positively voted.
Did you place consistently top10-top20 in div1? Or did you outperform an LGM once when they had a bad round. As always, you are distorting the facts and my statement. I wonder why.
Oh I only saw one. I now think this is very sus. This would be probably too unlikely for a legitimate contestant, but if it is true that they have gotten LGM-like perfs in in-person contests (I would want to know exact placings and which ones) that would pretty decisively prove their innocence. If not, I'd probably agree with you and say I'm some 95-99% sure this is cheating.
I just wanna add as a side note that I have, as well, beaten LGMs before
You don't have to flex dude...
😎
I beat an LGM once (he didn't submit anything)
You don't have to flex dude...
What's the problem with that C and why do you call it "serious problems"? Is it just you too weak to solve it and lost rating so you blame that harder C? To me that's a great problem bringing more challenges to contestant. Do not care rating, they're just numbers. Caring cheaters too much only farms contribution and wastes your time to practice, lowering your skills.
Ref: https://web.archive.org/web/20240815084933/https://codeforces.me/blog/entry/132507
contest is terrific, I very like it, prob B was very elegant
Years in the making
As a retired tester, this was my first in a while.
绷住了
As a python beginner, I'll begin to solve problems with Python in this round. Also thanks to fatalerror's guidance when I was learning it.
P.S: What a good time for Chinese users! God bless the authors and coordinators!
Remember to submit by PyPy instead of Python
We had considered 19:35 (UTC+8) but to avoid collision with AtCoder ABC we switched back to regular start time :(
Bad news....
Goodbye to good sleep and Leetcode biweekly again....
Does he/she know it's a Div2?
I know, it doesn't matter if I register unratedly though.
I have never ever seen a blue coordinator
Can we normalize opening cf accounts before judging them :)
Codeforces Round 965 (Div. 2) Annoucement, even specialist coordinator :)
Damn that's cool
Newbie coordinator when
As a tester this round is amazing! All problems are enjoyable to solve and well-prepared.
This contest went through two rounds of testing, so don’t expect any issues.
On a separate note, I want to mention satyam343. He was thoughtful during the testing phase, making polls, suggesting problem corrections, and, most importantly, sending monkey emoji.
*orangutan emoji
As a tester, I tested this round one year ago :cold_face:
Downvote me
No
No(2)
Thanks everyone for participating in Codeforces Round 1113 (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)
ummmm?
Bro is from the future
hope to be like the last one!!
l really want to achieve 1000 contest rating❤️
I'm sure you will. Good luck!
Thanks:)
Why is this round 22:35 again, I remember it being 19:05 originally (All times are UTC+8)
Now I can't participate because I don't usually go to bed that late :(
This round used to overlap with the usual atcoder beginner contest therefore the start time was modified.
I found one advantage of living in the middle East!!!
Hey everyone, I wanted to know if there are any requirements for proposing problems for Codeforces rounds. I've made a few problems on HackerRank just for fun, and I was wondering if anyone would be willing to review them. I'm a newly promoted Specialist, so I think they're mostly around Div. 4 or April Fools' Contest level. I'd really appreciate any feedback or suggestions. Thanks!
Codeforces generally only accepts proposals for Div. 1 or Div. 2 level contests. KAN's blog explains this in detail. I quote from it: "Also, we don't consider proposals for Div 3/4 or Educational rounds".
In practice, however, most Div. 1 or Div. 2 authors find it hard to set simple yet good problems like D2A–D2C, rated around 800 to 1750 (curse of knowledge, I guess). So there are still chances your problems can be seen even if you can only come up with simple ones (as long as they are good).
To get involved with the problem-setting workflow, I suggest you start by being a tester. There are basically no hard requirements for being a tester. Once you are involved in the workflow, you can get to know more people (authors and coordinators) and you may get more opportunities :)
Problem A: 500
Problem B: 1250
Chuckles, we're in danger (:
Hope we(I) will enjoy the WA's...
Love satyam343 round. Love chromate00 as a tester.
till you guys make more contest I'm happy and I think others are happy too.
what is the penalty in div3 ?
Seeing the score distribution, I feel that it would be better to open the entire problemset (which one should generally do); read problems B, C and D altogether and then attempt the one we're most comfortable with first.
Either it is going to be a very tough B or a SpeedForces round!
...and E = F = 2500. That's unusual.
₍^. .^₎⟆
NOooooooooooooo WHY these contests are always so late for the Chinese user? I cannot join any contests in my summer holiday Because I should get up about 6:50
what, samsoom is the real goat
As a tester, i hope everyone has a good performance
Down_vote me
sure
all the best guys!!!
I will be live post contest discussion stream here
I hope to solve 3 to 4 problems in this contest :-)
I am unable to register now
uh I late registered and it got accepted, but after submitting two problems it seems it says I am not registered anymore? Could someone please resolve, I cannot submit C rn
If anyone is having similar issue, use m1.codeforces, it works there for me
just a nice round ._.
After a long time non constructive D, and for me that makes B >> D, i got smashed by B, i give up on it
I registered for the contest during extra registration and submitted code for two problems.
Now, with half an hour left, the submit button is no longer there, and if I try submitting using the submit code tab, it is showing "You must be registered."
Never mind, It worked a few minutes later.
PS : after that, I only got WA. It was better when it was not working.
Good problems, thanks for the round.
I got lucky to guess that we just try any 2 blocks in $$$E$$$ to get a solution, lol.
Can You please give proof why 2 block is sufficient to get answer.
Read my comment again :)
what's the idea behind C? I try to search everytime max distance between two nums, add to result (r-l+1)^2, if not exist any pairs, add remaining count of nonpair elements. I think the idea not pretty hard.
The final answer can be written as choosing a bunch of ranges $$$[l1, r1], [l2, r2], ...$$$ and so on.
This should give you the idea of DP.
Your greedy approach is wrong. Try dynamic programming.
I don't get how my DP solution got AC on Problem C. It feels wrong to me, but got ac. DP Definition: dp[i] = maximum score achievable on the prefix 0...i. Transitions: If i is the first occurrence of arr[i]: dp[i] = dp[i-1] + 1 If i is the second occurrence of arr[i] (first seen at lst_seen): dp[i] = max(dp[i-1] + 1, dp[lst_seen — 1] + len * len) (where len = i — lst_seen + 1)
My Doubt: I don't get why taking dp[i] = dp[i-1] + 1 here is always valid. Why is dp[i-1] + 1 guaranteed to work even if the interval lst_seen...i is disjoint to the rest of the elements? can anyone explain me this?
Because you're counting it as a singular occurence, and if it were enveloped, you would take the dp from earlier no?
but for a testcase like
.........1 2 2 3 3 1
for the last element the transition dp[i-1]+1 is invalid right?
Yep but it chooses the range instead, it's a placeholder for if the other element has been consumed, and we want to just use the element at i on its own.
How is it invalid? Please make a recursion tree if you are not able to grasp the transitions. But what actually is surprising to me that how you came up with a perfect dp transition yourself (I assume) and still doubting it. This actually amazes me.
Here also, you are either considering dp[i] = dp[N — 2] + 1, or dp[N — 7] + 36. I agree with you that here, second pick would be larger but again, you can't ignore the case where first one would be optimal. This is what DP is!
i got wa at first for not adding this dp[i-1]+1 then just felt like adding that. here is the code: https://codeforces.me/contest/2248/submission/385182125 (wa)
https://codeforces.me/contest/2248/submission/385182522 (ac)
but i can not do this move
... 1 2 2 3 3 and 1 separately as when i need to pick 1 it will remove the whole segment 1 2 2 3 3 1
and when i pick 2 or 3 it doesnt matter 1 is still there.
I have just one question : Are you even aware about what your dp states are storing and how transitions work? This is what the problem actually demands. Though I took a different approach in transitions, which would eventually result in same thing. But yes, I am finding this simpler and more intuitive.
Coming to your question, why dp[i] should also have (dp[i — 1] + 1) as a decision.. The reason is simple, I would need to deal with certain singletons.
Consider A = [4, ... 1, .., 4, .. 1].
In such case, I would definitely need to select one of the X = 1, 4 As A singleton since the other one would be removed in the operation. So, either treat it as a singleton or just remove the entire segment containing X.
Hoping this answers your question!
tell me is this transition legal here!
2 2 1 3 3 1 -> 2 2 1 3 3 im simulating the transition dp[i-1]+1 but here this move is not legal. if i pick the last 1 then i must pick the whole segment 1..1 i can not take only the last one. i don't know if i got the problem wrong.
nice problems
i spent an hour to code, randomly testing problems B and C, idk but i think this contest is so difficult T-T
ad-hocforces
Ad-hoc problems force you to think logically, not like you know some data structures and then implement without deep insights so for me, I like ad-hoc problems.
It's not like there aren't problems that require data structures and algos without logical thinking, there's quite a lot of them actually, they aren't mutually exclusive.
Sure, but the quality of a problem isn't measured by whether or not it has a template DS and pure "ad hoc" problems tend to require cooler observations and arguments.
I am not saying that ad hocs are bad, I'm just saying that there are good ds and algo problems
Sorry bro, but i feel like more structure and algos also force you to think intuitively. But i get your point, its just the way i see how to approach stuff, im not some genius who gets a habit of solving these adhocs on a habit
I would argue that C was a very standard dp problem
Why D is D? isn't it like 3 times easier than C, basically just a small case work.
EF is a bit of strange combo. F is rather clear what is happening, solution is obvious (if you ask me, F with n, m >= 2 a proper div2D difficulty, however case handling for single row makes it harder which is always unpleasant. E is just a bit of guessforces problem, as it usually is where you look for examples with such freedom in inputs. Like, not that they don't fit their positions, they are just types of problems for which you don't get enjoyment from getting Accepted...
Really cool C by the way. G also interesting, but don't know how to solve
Thanks for the round! Outlines of my solutions:
A: Alice and Bob should delete the first $$$0$$$ and $$$1$$$, respectively. Proof sketch for Bob; the proof for Alice is analogous: suppose the first $$$1$$$ occurs at position $$$i$$$ and Bob instead deletes a $$$1$$$ at position $$$j$$$. Then, outside of positions $$$i, \cdots, j-1$$$, the resulting string is identical to if he had deleted the $$$1$$$ at position $$$i$$$ instead.
Let $$$t$$$ be the string consisting of characters $$$i+1$$$ through $$$j-1$$$ in the original string; then, deleting position $$$i$$$ results in $$$t$$$ appearing before the $$$1$$$ originally at position $$$j$$$, while deleting $$$j$$$ results in $$$t$$$ appearing after the $$$1$$$ originally at position $$$i$$$. Moving a $$$1$$$ to the right in the string never makes it lexicographically larger, so the string if Bob deletes $$$i$$$ is at least as lexicographically small as if he deletes $$$j$$$.
B: Since the $$$n+m$$$ integers are distinct, we need to use at least two values in $$$a$$$ to produce each value in $$$b$$$, so the answer is no if $$$n \lt 2m.$$$ Then, it is optimal to use the smallest $$$m$$$ and largest $$$m$$$ elements in $$$a$$$ to create $$$b$$$, using the $$$i$$$'th element of the first set and the $$$i$$$'th element of the second to create the $$$i$$$'th element of $$$b$$$. Thus, we can check whether element $$$i$$$ of $$$b$$$ is between the $$$i$$$'th smallest and $$$(m-i-1)$$$'th largest elements of $$$a$$$ for all $$$i$$$; if so, the answer is yes.
C: Consider the set of values for $$$x$$$ that we choose while both copies of $$$x$$$ remain in the array. Note that we cannot choose two values $$$x$$$ and $$$y$$$ if the copies of $$$x$$$ and $$$y$$$ appear in the array in the order $$$x, y, x, y.$$$ Also, if they appear in the order $$$x, y, y, x,$$$ then it is not optimal to choose $$$y$$$ and then $$$x$$$ (never operating on $$$y$$$ and operating on $$$x$$$ instead will lead to a higher answer because the objective function is convex).
Thus, the elements we choose when they appear twice must form a set of non-overlapping intervals. This allows us to do DP, where $$$dp_i$$$ is the maximum score that can be achieved using the first $$$i$$$ elements. To transition from $$$dp_i$$$, we can either use element $$$i+1$$$ when only one copy remains, achieving a score of $$$1$$$, or we can use element $$$i+1$$$ when both copies remain. If the other copy of element $$$i+1$$$ is at position $$$j$$$, this allows us to transition to $$$dp_j$$$ while earning a score of $$$(j-i)^2$$$. The answer is then $$$dp_n$$$.
D: Note that any two operations with $$$c = 0$$$ can be combined, and likewise for $$$c = 1$$$. Thus, we can assume we do one operation of each type for each query.
Split the positions into four groups based on whether their values in $$$s$$$ and $$$t$$$ are $$$0$$$ or $$$1$$$; define $$$cnt_{ij}$$$ to be the number of positions with values $$$i$$$ and $$$j$$$ in $$$s$$$ and $$$t$$$. Without loss of generality, assume $$$cnt_{01} \geq cnt_{10}$$$ (the other case is symmetric). Then, if $$$cnt_{01} \gt cnt_{00} + cnt_{11} + cnt_{10}$$$, the answer is no: $$$01$$$-positions will need to make up a majority of either the $$$0$$$ operation or the $$$1$$$ operation, and in either case one of the two strings ends up with the wrong mode.
Otherwise, the answer is yes. Pair off all $$$10$$$-positions with a $$$01$$$-position; we can add each pair to either operation without affecting the modes. Then, pair off the remaining $$$01$$$-positions with a $$$00$$$-position or a $$$11$$$-position; these pairs can be added to the $$$c = 0$$$ operation or the $$$c = 1$$$ operation, respectively, without causing either string to have the wrong mode (since they add at least as many $$$0$$$s as $$$1$$$s, respectively, to both strings). We can add any leftover $$$00$$$-positions and $$$11$$$-positions to the $$$c = 0$$$ and $$$c = 1$$$ operation, respectively.
E: We can quickly observe that $$$a$$$ should end with $$$c = p_i$$$ for some $$$i$$$. Note that in an array consisting of $$$|a|$$$ ones, the contribution of each index to $$$v$$$ forms an array with period $$$n$$$. If, for any $$$p_i$$$, there exists $$$j$$$ such that the contribution of the $$$p_i + 1$$$ elements starting from position $$$j$$$ in this cycle is less than the contribution of the first $$$p_i$$$ elements, then we can take $$$a$$$ to be $$$j-1$$$ ones followed by a $$$0$$$ and $$$p_i$$$ 1s. Otherwise, it can be seen that the answer is NO, as we can delete the last $$$0$$$ and all succeeding $$$1$$$s without decreasing $$$f(a) - f(I(a))$$$, and if we repeatedly perform this operation we will end with an array $$$a$$$ containing only ones, which has $$$f(a) - f(I(a)) = 0$$$.
This gives an $$$O(nm)$$$ solution (with $$$m$$$ choices for $$$i$$$ and $$$n$$$ choices for $$$j$$$). The key observation from here is to realize that we should take $$$j = p_k + 1$$$ for some $$$k$$$, since if $$$j$$$ takes any other value, decreasing it by $$$1$$$ will never increase the sum of the next $$$p_i + 1$$$ elements of our cycle. This gives only $$$O(m^2)$$$ cases to check, which is sufficient to solve the problem.
F: Consider the value $$$3v_{x, y} - \sum_i v_{i, y} - \sum_j v_{x, j}.$$$ This sum has to be nonnegative for $$$(x, y)$$$ to be a peak; call this value the margin for $$$(x, y)$$$. Performing an operation on the entire array will increase the margin of all elements by $$$n+m-3.$$$ The only way to potentially increase the margin by a greater value in a single operation is to cover all elements in the row or column except for $$$(x, y)$$$, which increases the margin for $$$(x, y)$$$ by $$$\max (n, m) - 1.$$$ This is greater than $$$n+m-3$$$ if $$$\max (n, m) \gt n+m-3$$$, which is equivalent to $$$\min (n, m) \lt 2.$$$ Thus, if $$$n, m \geq 2$$$, we should perform all our operations on the entire array, and we can binary search for the answer to solve the problem.
Now, suppose $$$m = 1$$$. In this case, if we perform an operation on all elements but the first or last, the excluded element's margin increases by $$$n-1$$$ while all other elements' margins increase by $$$n-3.$$$ It can be shown that we should perform no operations other than operating on the entire array or operating on all elements except either the first or last. Additionally, if we perform one operation on all elements but the first and another on all operations but the last, it is superior to replace both with operations on the entire array, so we should only perform one of these two types of operations.
If we fix the number of operations we will perform, we can compute how many operations have to exclude the first element for that element to be a peak, and likewise for the last element. This gives us three cases (performing all operations on the whole array, forcing the first element to be a peak, and forcing the last element to be a peak), and we can check each of them individually. This allows us to binary search the answer as in the $$$n, m \geq 2$$$ case.
G: Let $$$K = 125000.$$$ We first compute which bundle costs up to $$$K$$$ are achievable. To do this, note that we can split any number of goods with cost $$$c_i$$$ into either zero or one each of goods with cost $$$c_i, 2c_i, 4c_i, \cdots.$$$ Thus, we repeatedly add $$$2c_i$$$ to the list of valid prices for each valid $$$c_i$$$. Then, we can use bitsets to compute the list of achievable bundle costs in $$$O(K^2 / 64).$$$
Now, let's first imagine we can only make purchases that reduce our number of coins and figure out which balances can be reduced to zero. For each achievable bundle price, figure out how much it reduces our balance and the minimum ending balance. Then, we can maintain a bitset of achievable balances and simulate the process in reverse. Initially, 0 is the only achievable balance. We can sort the baskets by minimum ending balance and use bitsets to maintain the set of achievable balances (toggling off all balances less than the minimum ending basket for the current balance). Note that we have to use a similar trick to the first step: if it's possible to end at a certain balance after decreasing our balance by $$$x$$$, we can also do this for $$$2x$$$.
What if we can increase our balance? First, find the minimum starting balance from which we can increase our balance. Then, we can make our balance arbitrarily large. From here, we can change our balance by any multiple of the GCD of all possible balance changes from any basket. If our balance is congruent to $$$0$$$ mod this GCD, and if the smallest price is less than the first rebate cutoff, we can win by turning our balance into a large multiple of the smallest price and then buying the smallest price item repeatedly. Otherwise, we cannot win (since our balance will never become $$$0$$$ mod this GCD, or since we can never get to balance zero if there's no bundle we can buy without getting a rebate).
It remains to compute this GCD. We can directly find the balance changes achievable with baskets costing less than $$$K$$$. Any baskets costing greater than $$$K$$$ must achieve the largest rebate; we can choose an arbitrary such basket and compute how much it changes our balance, incorporating it to our GCD. Then, since we can add any price to the bundle of our basket, the Euclidean algorithm tells us that the GCD of all balance changes must be divisible by all of the prices. This is enough to find our GCD (as all balance changes from a basket with cost greater than $$$K$$$ must be a multiple of the GCD of our starter basket and all item prices), which completes the problem.
A few subjective thoughts: Overall, I enjoyed the problems, and I thought they were more interesting than average among Div. 2 rounds. I would have had a bit more fun if the sample tests were somewhat stronger (particularly for G, since writing a stress test for this problem isn't completely trivial), but I think that offering weaker samples was a legitimate choice/falls within the authors' discretion here.
I personally found F substantially easier than E, though in fairness the score distribution indicated that F would at least not be much harder than E. I also thought B was surprisingly easy given its assigned score. I found D easier than C, but I think I just happened to take a bit longer on C than on most problems of its difficulty level, and the objective difficulty of the two problems is pretty close together.
Thanks again to the authors!
I agree D felt a lot easier than C
Also had this thought )
were todays contest question were some pateren type question
goat is back
The goat
D < C?
why? i think c<d
Hello Codeforces,
Could anyone please review user
p3n_ph1’s submission to Problem F in Codeforces Round 1113?Submission:
https://codeforces.me/contest/2248/submission/385184180
The F code is completely different from the user’s A-E submissions: their usual template, macros, formatting and naming style disappear, while polished comments such as “1D Array Routing” and unnecessary defensive input checks suddenly appear.
GPTZero (
https://app.gptzero.me/) classified the complete F code as 100% AI-generated. I understand that this result is not proof by itself, so I am only requesting a manual comparison and investigation.Thank you.
.sorry I got a wrong user. Ehundategh is good
GPTZero is meant for standard text (e.g essays, blog posts etc), not for code
contest shook me dead, still so many people solving so many questions
Thanks for the round! In my totally unbiased view, the problems were great.
I think I had some unintended solutions,
For G I had the right complexity but way slower constant, and skipped some steps in the editorial by instead using more bitsets. So maybe conceptually an easier solution, but was definitely harder to implement and get it in the memory and time limit.
For E I mistakenly thought we should additionally check for all $$$p_i$$$, the strategy of placing a super long string of $$$[1] \cdot p_i + [0] + [1] \cdot p_i + [0] + \dots $$$, and we can check whether this is better by just comparing the gain per length unit, and I switched to python to do these comparisons with fractions (although in actuality doing them in C++ with __int128_t isn't hard either). Turns out you don't need this strategy at all, and I overcomplicated my proof.
-1
Regarding plagiarism check for problem D (submission 385160953)
Hi, my handle is Sandilya003. I was flagged in the automated similarity check for problem D alongside some other participants.
I want to state clearly that I wrote my solution independently during the contest and did not share code with, or receive code from, any other participant.
I've reviewed my own accounts for possible unintentional leakage:
I do not use ideone/pastebin with public visibility for contest code. [My GitHub does not auto-sync or publicly mirror my Codeforces submissions]. I am not part of any group where solution code is shared during or immediately after contests.
I'm happy to provide any additional information needed to help resolve this. Thank you for reviewing.Have a good one. If anyone else know what i am supposed to do please let me know, Thanks.
Whatever I have done problems in this contest before were interesting .. Thanks to szdytom
Hello, I received a rules-violation message regarding my submission 385170583 for problem 2248D. During the round, I used an AI assistant to discuss the problem and obtain help with the solution. I now understand that this constitutes external assistance and violates the rules, even though I did not intentionally share code with or copy from the other listed participants. I sincerely apologize and accept the penalty for this round. I will not use AI tools or seek any external assistance during future Codeforces contests. At present, while logged into my account, I cannot open any problem page, including unrelated problems; the site only displays the “Oops! Probably Codeforces can't be reached” page, while the same pages work from another account on the same device and network. I respectfully ask whether normal problem access can be restored. Handle: radiant_abyss Submission: 385170583 Thank you.
regarding problem D (solution 385150468), my code is verdicted as significantly coinciding with other's solution I was writing my code on OneCopiler, but I didn't save my code neither on the webside (it needs to be operate manually) nor my computer , there couldn't be any leakage. For anything I can still provide, please tell me, thanks!
Hi, my submission 385171691 for 2248D got flagged against 385161196 (Udit98) and 385162041 (hariom_singh). I solved it on my own and I'd like to ask for a manual check.
Here's how I got to the solution, and I think it explains why the code came out looking the way it did.
First thing I noticed is that order doesn't matter at all. Whether an operation is allowed only depends on how many of each character you picked, not where they are, and deleting positions doesn't change anything for the positions you didn't pick. So the problem is really just: can you split the positions into groups where each group is deletable in one move? Throwing away the ordering and keeping only counts is a pretty standard first move on string problems like this.
Second, since s[i] and t[i] are each 0 or 1, every position is one of four types: 00, 01, 10, 11. So instead of two strings I just have four counters. Classifying positions into types like this is the usual way these two-string problems get simplified.
Third, the mode condition. For c=0 to be a mode you need at least as many 0s as 1s, which means zeros minus ones ≥ 0. That's the standard trick of mapping 0 to +1 and 1 to −1 and looking at the sum, the same thing you do in "longest subarray with equal 0s and 1s" or in bracket balance problems. Write P for that value in s and Q for it in t. Then c=0 works if P ≥ 0 and Q ≥ 0, c=1 works if P ≤ 0 and Q ≤ 0, so a group is fine unless P and Q have strictly opposite signs.
Fourth, once you look at the four types through P and Q: a 00 position adds to both, an 11 subtracts from both, so neither of those can ever make P and Q disagree. Only 01 and 10 do, and they pull in opposite directions from each other. So a 01 cancels a 10, and whatever is left over has to be soaked up by pairing it with a 00 or an 11.
That's the whole answer. With A, B, C, D as the counts of 00, 01, 10, 11: it's YES iff |B − C| ≤ A + D. This "the leftover imbalance must be at most what's available to absorb it" shape is extremely common, it's the same condition as pairing up items of different types being possible iff the biggest pile is at most the sum of the rest, and it's the same shape as the triangle inequality. Once you see it you basically write it down without thinking.
And then it's three prefix sums and one comparison per query, which is the most standard range-query technique there is.
About the similarity. I'm not going to pretend the code isn't similar, it is. But every step above is a well-known move, and the last two steps leave almost nothing to decide. One loop, three prefix arrays, one abs() check. It's about 15 lines. The order of the arrays (01 count, 10 count, match count) just follows the order the terms appear in the inequality. I'd guess a lot of accepted solutions look like this.
One thing I would point out though. The two flagged submissions have the same main() as each other, character for character:
ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while (t--) solve();
Mine is different at every single one of those spots. ios:: instead of ios_base::, nullptr instead of NULL, tc instead of t, and I wrap the read in if (cin >> tc). I also open solve() with if (!(cin >> n >> q)) return;, which neither of them has and which does nothing useful on Codeforces. It's just a habit from writing code that reads till EOF. Those bits show up in every problem I submitted this round, so I'd ask that my code be compared against my own history and not only against these two.
I didn't share my code with anyone during or after the round, didn't put it on ideone or pastebin or any repo or group chat, and didn't see anyone else's solution. I don't know either of those accounts.
Thanks for taking a look.
Hello MikeMirzayanov and szdytom,
I am requesting a quick manual review of my submissions for Round 1113 (Div. 2) for problems 2248D (385136748) and 2248E (385151712). I wrote this code independently, the similarities are purely due to the standard logic required for these specific problems.
2248D: The optimal solution is essentially just taking the prefix sums of character mismatches and answering range queries. Because the required logic is so brief and standard, almost any clean C++ implementation will inherently look structurally identical.
2248E: Here, my implementation details clearly distinguish my independent work. I structured my logic using two separate helper lambdas (get_g and get_f) to compute values dynamically, and I used a bool ok flag to break out of the candidate loop early. The other flagged submissions use a fundamentally different structure, relying on a single lambda and tracking a global max_val variable to evaluate against the threshold.
Since both problems rely heavily on standard C++ techniques (like prefix arrays and upper_bound), independent codes will naturally converge. I kindly ask you to manually review the codes once please.
Dear Codeforces Support Team, My Codeforces account NANAM has been recently disabled with the message "The user is disabled". I am writing to sincerely appeal this decision. I participated in the recent contest Codeforces Round 1113 (Div. 2), specifically on Problem 2284D ,and I am 100% certain that I solved the problems independently without any cheating or sharing code. My submission ID for this problem is 385186299. If my code triggered a false positive due to standard optimal solutions or structural similarities, I kindly ask you to manually review my submission logic. I truly value my account and the platform, and I hope you can reconsider this action. Thank you for your time and understanding. Best regards, An Nam Ngo. In my old code about Approve node : https://ideone.com/YwEoB0 (2025 — 12 — 24 I used a similar template. I guarantee that it is 100% my code. It just uses a template that looks similar than joker_king_hkust_1;
https://codeforces.me/contest/2248/submission/385186299