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

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

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:

Score distribution: $$$500-1250-1500-1750-2500-2500-3500$$$

We sincerely hope that you will enjoy the problems!

UPD: The Editorial is out!

UPD: Congratulations to the winners!

Unofficial participants:

  1. jeroenodb
  2. 244mhq
  3. Geothermal
  4. StarSilk
  5. kotatsugame

Official participants: (subject to change)

  1. tuanha
  2. goldenutu
  3. ising36hz
  4. wtzakioi
  5. kylin0610
  • Проголосовать: нравится
  • +352
  • Проголосовать: не нравится

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

As a tester, I can confirm that nifeshe is goated at queens, and I hope he reaches gm one day

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

Congratulations satyam343 on his first coordinated round!

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

Years in the making

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

As a retired tester, this was my first in a while.

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

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!

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

I have never ever seen a blue coordinator

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

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.

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

As a tester, I tested this round one year ago :cold_face:

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

Downvote me

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

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)

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

hope to be like the last one!!

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

l really want to achieve 1000 contest rating❤️

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

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 :(

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

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!

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

    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 :)

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

Problem A: 500
Problem B: 1250
Chuckles, we're in danger (:
Hope we(I) will enjoy the WA's...

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

Love satyam343 round. Love chromate00 as a tester.

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

till you guys make more contest I'm happy and I think others are happy too.

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

what is the penalty in div3 ?

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

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!

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

₍^. .^₎⟆

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

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

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

what, samsoom is the real goat

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

As a tester, i hope everyone has a good performance

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

Down_vote me

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

all the best guys!!!

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

I will be live post contest discussion stream here

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

I hope to solve 3 to 4 problems in this contest :-)

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

I am unable to register now

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

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

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

just a nice round ._.

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

After a long time non constructive D, and for me that makes B >> D, i got smashed by B, i give up on it

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

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."

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

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.

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

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.

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

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?

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

    Because you're counting it as a singular occurence, and if it were enveloped, you would take the dp from earlier no?

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

    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!

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

      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.

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

nice problems

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

i spent an hour to code, randomly testing problems B and C, idk but i think this contest is so difficult T-T

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

ad-hocforces

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

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

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

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.

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

D < C?

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

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.

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

contest shook me dead, still so many people solving so many questions

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

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.

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

-1

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

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.

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

Whatever I have done problems in this contest before were interesting .. Thanks to szdytom

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

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.

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

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!

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

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.

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

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.

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

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;