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

Автор N29, 7 месяцев назад, перевод, По-русски

Hello, Codeforces!

I am very excited to invite you to our contest Codeforces Round 1054 (Div. 3), which starts on . You will be given 7 problems and 2 hours and 15 minutes to solve them.

The problems were authored by me and __rose and soullless to solve and alter them.

The round will be hosted by the rules of educational rounds (extended ICPC). Thus, all solutions will be judged on preliminary tests during the round, and after the round, there will be a 12-hour phase of open hacks. After the open hack phase, all accepted solutions will be rejudged on successful hacks. Also, note that there is no score distribution — rank will be determined by number of problems solved, followed by penalty; wrong submissions will incur the usual penalty of 10 minutes, following the rules of educational rounds.

Remember that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them)

  • do not have a point of 1900 or higher in the rating.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you.

We would like to thank:

UPD : the editorial is out

  • Проголосовать: нравится
  • +264
  • Проголосовать: не нравится

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

first comment!!

»
7 месяцев назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится
┈┈┈┈┈┈┈▏▕
┈┈┈┈┈┈┈▏▕▂▂▂
▂▂▂▂▂▂╱┈▕▂▂▂▏
▉▉▉▉▉┈┈┈▕▂▂▂▏
▉▉▉▉▉┈┈┈▕▂▂▂▏
▔▔▔▔▔▔╲▂▕▂▂▂▏
»
7 месяцев назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Nagi proving once again that being a lazy genius is still genius enough for CF

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

4th comment!

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

__baozii__ really wants to Reach igm

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

.

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

As a blue tester, I am not a blue tester.

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

Codeforces x Bluelock?

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

As an orange tester, I am purple

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

Nice Image

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

^_^

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

100% goated round

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

Thanks to Konrad Zuse for iventing the computer.

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

Blue Lock mentionedddeddd!!!!! Goated round

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

As a tester, I encourage you to participate in the round. Nice problems.

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

GOATED ROUND BLUE LOCK MENTIONED

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

Anything the authors can do to help with the crawling bans during the hacking round would be greatly appreciated.

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

    And I've been banned for crawling...

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

      Why are you hacking problems if you're not participating in the contest? Maybe you should go outside, touch the grass, and breathe some fresh air?

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

        Why are you saying I wasn’t in the contest?

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

          Because it wasn't rated for you, why hack other people's solutions if you don't get points for them? It seems like you really have nothing better to do.

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

            A 12 hour hacking session is actually a great practice area to get better at hacking for div1/2 rounds. In those rounds, you are under time pressure, and there is a penalty for a failed hack. Are you suggesting I learn how to hack with my rating on the line and with bigger downsides, both in time to solve other problems + the negative points for a failed hack?

            In terms of the net effect on you from my activities, you would have been hacked anyway. My efforts simply notified you sooner of the outcome + you can see the full test case that specifically hacked your code. If you had TLE on the final test set instead (other people were also doing hashmap hacks), it would take much greater effort to figure out what that hack generating code was.

            It seems in general your concern is that you submitted code, it passed, and then it failed later. That possibility occurs because of the rules set up by codeforces, and this possibility is in all rounds (div1 through div4). My view on hacking rounds is the following: It's already a lot of work to create good problems, and hacking rounds lower the burden on problem authors for generating great contests.

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

Lazy genius :-:

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

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

Sorry if I'm missing something obvious, but can't seem to find how long the contest is. 2 hours? 2:15? 3:00 (unlikely)?

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

Me to div3 when i was a struggling cyan

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

This time,i will prove myself! At least 4 problems!!!

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

As a participant,I'll do my best to solve all problems of this contest

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

As a participant, i hope to AK the round!

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

Hope to have a good contest

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

Unrated registration is not available?

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

Hope to reach expert :)

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

this is my first contest.wish I can do well

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

I'll do my best to solve the problems in this contest

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

Blue lock x codeforces?!

Can wait for Rin destroyer mode to destroy me (╯˘ -˘ )╯

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

Abolish the idea of winning by chance, and claim victory as a logical sequence ------> Jinpachi Ego

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

fire!

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

Mikage Reo should better be in rest in this contest, no copying. >:(

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

blue lock rahhhhhhhhh

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

I am doing this contest in the airport as my flight has been delayed. I hope my flight is delayed longer so that I can get more submits.

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

Wish to AC 4 questions

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

Codeforces is really fast and smooth today. How can you achieve this?

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

This was the weirdest contest I have done in my life. great work !!

very fun problems

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

I hope G isn't intended to be solved with randomization

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

    I solved G with random because of very simple realization, but I also believe that solution which uses kth-stat on the interval to get possible values, is able to get AC

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

    my solution to problem G does not rely on randomization.

    solution

    edit: this got hacked, its correct but it's not good enough

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

    It can be solved using extended boyer moore's algorithm with segment tree.

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

    i solve with randomiztion but got wa so i use boyer moore

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

G is not original, infact it has appeared on codeforces itself. 840D - Destiny

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

very nice contest, loved F. couldn't find how to optimize G.

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

Please tell me E was sliding window

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

how to solve F?

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

Fantastic round. Njoyed D a lot:)

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

About E

I think it’s something about sliding window, but I’m stuck on finding a convenient way to quickly check if subarrays have exactly k distinct numbers :(

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

nice balanced round !! Appreciate it

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

Is G solvable with Mo's algorithm? I can't eliminate the O(logN) part when updating.

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

My thought process for $$$F$$$ was as follows:

  • the final $$$ans$$$ can be written as $$$d + x$$$ where $$$x$$$ is the number of turns spent in rest.
  • we know the sum of natural numbers series for $$$i = 0, 1, 2, 3, 4, ...$$$ is $$$0, 1, 3, 6, 10, ...$$$
  • for a fixed value of $$$x$$$, we want to choose atmost $$$x + 1$$$ indices $$$i$$$ such that $$$i_1 + i_2 + \dots + i_{x+1} = d$$$ and $$$\frac{i_1(i_1+1)}{2} + \frac{i_2(i_2+1)}{2} + \dots + \frac{i_{x+1}(i_{x+1}+1)}{2} \lt h + x$$$
  • the range for $$$x$$$ is $$$0 \le x \le 10^9$$$ ($$$x = 10^9$$$ when $$$d = 10^9$$$ and $$$h = 2$$$) (is this range correct?)

  • and we can binary search over this range and find the minimum value of $$$x$$$, but how to check the condition?

Is my approach even remotely correct lol?

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

Is E need persistent segment tree or it is simpler than this ?

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

ts was ass icl

not only was there a complete lack of problem solving in this contest up to including e (probably later problems as well if i had to guess)

half of these were knowledge checks or leetcode ah problems

when its very obvious how to solve the problem, and it takes the entire later part of the contest to implement... hint hint, probably not a fun problem, we use this site for problem solving, go set on leetcode if you think these are good tasks

oh and a side effect of it being very standard!!!!!! a lot of indians will be solving it! theyre very good at standard implementations huh?????

anyways tldr: tspmosmicl

update: I was doing binsearch on BIT for e, turns out spamming pdbs is easier, but my argument about it being too standard still stands.

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

THE END!

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

Did someone else face 403 Forbidden error during the contest? It happened to during the entire contest. I had to switch to mirror CF.

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

3 again T-T, what even is failed on 8th TC.

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

Overall great contest

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

For the problem G, WHY NO -1 IN THE SAMPLE CASE ??????????????????????????????????????????????????????????????????????????????????????????????????????

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

GPT passed G with Mo's Aglo. Link

Can someone check if its hackable or not?

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

At first I thought, “Wow, the Kazakhs organized a contest, the problems must be great.” While participating, I found problems A–C quite good, but the rest felt kind of strange. On top of that, with AI one could easily AK this contest.

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

Editorial?

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

I'm 958 rated but the contest was unrated for me? Was really hoping to gain some points...

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

I solved A-E in around 45 minutes, official ranking was 300, and then so many people solved F and G using LLM and I dropped to 1300. (A problem similar to G already exist on CF and is rated 2500 but there is no way low rated people knew it).

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

I think the time limit is so tight, here 340510152 I was compressing the array using a set and a map but it didn't pass. But when I compressed using sort and binary search instead it passed. 340511269 I understant that it should be a bit faster but they are still the same time complexity O(n * log n).

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

i see some people submitting all their solution at the last minute? why is that

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

can anyone hack my cheese in D? I only find the "stick spot" around the average index +- 100

340513009

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

I noticed that today’s Div. 3 Problem G feels very similar to 840D — Destiny . I know Codeforces usually avoids repeating problems, so I was a bit surprised. It doesn’t seem entirely fair, since people who have already solved 840D might have an advantage in today’s contest.

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

Can someone explain that why we should calculate the operations from median on question D?

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

    to minimize the cost. If we take the middle one then the left ones and right ones will give the lowest cost by swapping. If we take any random a or b then the opposite side will not give the lowest cost that's why median is the answer.

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

    The answer can be calculated by accumulating the elements to a particular position i. For such a i, if it moves one position to the right, the answer will increase by rcnt — lcnt, where lcnt represents the elements with positions less than or equal to the i, and rcnt represents the elements with positions greater than the current position. Then for any i, moving towards the median position, the answer must be decreasing, so we have to consider the median.

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

Thank you for the great contest.

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

DEEPWOKEN MENTIONED

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

A lot of newbies in top 100 .They literally are not letting us to know our real level !!

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

is f greedily make as many consecutive moves as possible and restore 1 hp if needed?

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

Proud to present screencast again

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

Crazy E . Felt like dp problem looking at first

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

__rose and soulless, there are some unexpected verdicts on problem G that need to be resolved. Thanks

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

Should we use lambda function in questions involving mo's algo

as it is very common to create insert , remove function in lambda , however such problems are usually along with high constraints and lambda function have additional overhead as compared to normal functions declared globally

so should we adapt y-combinater

, so is the risk valid?

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

Tutorial when ? Really interest about last problem -> majority elements for multiple query !!

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

    I made $$$O(n \sqrt{n} \log{n})$$$ pass with this Mo's order, lol.

    std::sort(queries.begin(), queries.end(), [&](const query &x, const query &y) {
      int bx = x.l / b, by = y.l / b;
      if (bx != by) {
        return bx < by;
      }
      if (!(bx & 1)) {
        return x.r < y.r;
      }
      return x.r > y.r;
    });
    

    4.1s (very close to 4.5s) but it counts :D

    But to 'really' solve this, I'd suspect you'd use something like random sampling ($$$1/3$$$ probability per attempt) coupled with the fact that there can only be $$$2$$$ elements to maybe get $$$\log^2$$$ per query.

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

Got stuck on F for 1.5 hours during the contest and another 2 hours after it. Then carefully translated the problem on paper into another one: find min(k) such that there exists a set of natural numbers xi with x1+…+xk = d and h+k-1 > Σ(xi(xi+1)/2). Output d+k-1. The last approach took 20 minutes and no need to debug. Submission

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

Nice Div But it was full of CHEATERS --_--

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

340503636 My randomized solution for G.

Improved version: 340545798.

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

People are still hacking using Python hash collisions. Didn't we agree to stop that already?

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

More Blue lock themed Questions!!!!!

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

can someone tell me where im going wrong in E?

i applied sliding window and returned max(k, [l,r]) — max(k-1, [l,r]) submission: submission WA6

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

D is not original, infact it has appeared on codeforces itself. 1520E - Arranging The Sheep

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

16 times submit on problem G. What's a nightmare :(

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

wtf thumbnail is this?totally irrelevant and bs

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

Who is dark DarkTemplarDrop. why he hacked most codes? He didn't even participate in the contest. Why bro did it ?

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

please quick editorial otherwise problem C will haunt me for days

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

    First, to make the result of "mex" equal to k, array a must contain numbers 0 through k-1. If any of the numbers 0 through k-1 don't exist, we need to modify them. We prioritize those where a[i] == k, as a[i] == k will affect mex=k. If further modifications are needed, we modify those where a[i] > k, as these won't affect mex=k. Hopefully, you understand.

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

    Try to solve some mex questions then you will get it eventually

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

For people who solved G using randomized algorithm, what is the lower bound on the number of indices you search per query and is there any way to derive it for a specific n?

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

    Let's assume the worst-case: r-l+1 = 2 mod 3, and there are 2 numbers which occur (r-l+2)/3 times. The probablity of not getting a correct answer with k iterations is approximately (2/3)^k*2, let's denote it as p. We can choose k to be 50 to make this probability roughly 3*10^(-9). Since we didn't use n in our calculations, there are no bounds on n. k that we choose depends on the total number of queries. Math. expectation of the number of queries needed to get the first wrong answer is 1/p and we want it to be much more than the total number of queries.

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

Why this is Showing Unrated for me ??

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

    Same problem , Codeforces Round 1054 (Div. 3) , this was my first contest in this platform , I registered for it beforehand but it is showing as an unrated contest , I did not get any rating from this contest. Can anyone explain me why ?

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

Codeforces Round 1054 (Div. 3) , this was my first contest in this platform , I registered for it beforehand but it is showing as an unrated contest , I did not get any rating from this contest. Can anyone explain me why ?

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

HI everyone i need to konw why Div 3take long time for Correction i think if i correct all the sub i will faster then codeforce XD

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

It seems that problem G can be simply solved by Mo's Algorithm without thinking.

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

Can someone please check why my solution for D is wrong?

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
#define mod 1000000007

void solve()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    
    int op1 = 0;
    int op2 = 0;
    
    int l = 0;
    int r = n-1;
    while(l<n && s[l] == 'a')
    {
        l++;
    }
    while(r >= 0 && s[r] == 'a')
    {
        r--;
    }
    for(int i=l; i<=r; ++i)
    {
        if(s[i] == 'a')
        {
            if(i-l > r-i)
            {
                op1 += r-i;
                r--;
            }
            else
            {
                op1 += i-l;
                l++;
            }
        }
    }
    l = 0;
    r = n-1;
    while(l < n && s[l] == 'b')
    {
        l++;
    }
    while(r>= 0 && s[r] == 'b')
    {
        r--;
    }
    for(int i=l; i<=r; ++i)
    {
        if(s[i] == 'b')
        {
            if(i-l > r-i)
            {
                op2 += r-i;
                r--;
            }
            else
            {
                op2 += i-l;
                l++;
            }
        }
    }
  
    cout<<min(op1,op2)<<endl;
}


int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        solve();
    }
}

this my code

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

When do we get the result of this round, mean rating of ours? its already been more than 12 hours!!

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

Can someone point out the mistake in my solution for problem — D ?

Submission -> 340571620

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

That's my first contest after I know this palntform and register it.No bad.Thought I can't solve all problems,I will do my best,and finish it one day.

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

Whoa!! A round that wasn't tested by __baozii__

Great problems either way, tho I couldn't participate

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

When the editorial will be released ?

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

Hello, my handle is ShashS02. I am a new user and I participated in this round. I registered more than 24 hours before the contest started, but my participation was marked as unofficial and I did not receive a rating. Could you please look into this? Thank you.

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

why the rating is not updated i am 922

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

The questions are interesting (and relatively simple; I like this round),but I need the editorial TAT

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

After a long time a proper div 3 contest, problems were balanced according to div 3 and also I achieved expert :)

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

thanks for this wonderful round!

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

hello team, my self bipashab. i confirm from my side that i was not at all connected with the peole with which my solution 339588836 matches completely. i had solely written them by myself and might have got leaked by someone else.

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

Yay im specialist now

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

im miss it. when will the div.4 and div.3 round start again?

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

the best +150

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

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

Why does my solution for problem C gave TLE on test 5, even though it's O(n) 340419075

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

Hii can anyone help me here, Why is my solution to Problem C giving TLE on 7th test case Submission Details

t = int(input())
for _ in range(t):
    n, k = [int(x) for x in input().split()]
    a = [int(x) for x in input().split()]
    if k == 0:
        print(a.count(0))
    else:
        curr = a.count(k)
        seta = set()
        for i in a:
            if i < k:
                seta.add(i)
        required = k
        available = len(seta)
        print(max(curr, required - available))

According to my understanding this is still O(n) or max O(nlogn) I'm all ears, It's been a while since i started CP again, maybe I'm missing something Thank you in advance

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

    you forget to multiple it with t because we have t queries, if your solution is O(nlogn), i think O(nlogn * t) is correct

    for example, maximum of t is 1e4, n is 2e5, log n approximately equal to 5, let calculate, 2e5 * 5 * 1e4 = 1e10, maximum number of calculations that can be done on codeforces in seconds is 1e8 and 1e10 / 1e8 = 1e2, that mean it take 100 seconds so i think that tle!

    Sorry for bad English T_T

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

    You would normally be correct that this should be O(n) average time complexity; and the sum of all n is 2*10^5 so this should pass. However, since you are using python, you should know that sets in python are unordered, which means they have O(1) insert on average but O(n) worst case; in the very worst case your code takes O(n^2) to run after inserting n elements each in O(n) time.

    This is opposed to c++'s set which is ordered (and does doesn't fall to this issue but instead runs in O(n log n)). The alternative solution to this problem that works in python would've been instead to not use a set to check if an element is present but use a frequency array; a list that counts how many times a number has been seen (e.g. a list named frequency has frequency[2] count how many times 2 has been seen among all numbers in the input).

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

Ain't using unordered_map anymore....F hash collisions :)

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

well done, good contest. but i can't understand problem G till now, what a dispiriting problem.

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

340744591 why is my solution wrong cant think of a test case where this would go wrong please lmk o/w

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

I'm a beginner at Codeforces. I recently gave a Div. 3 contest, and I solved 2 problems, but why is there only an increment of +37(why so low)? My rating before the contest was 803 and after 840

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

I am really sorry to comment here and I know I will be getting the downvotes but It is going out of hands now. From the past 5 to 6 contest of mine I have recieved system flags in three of them. I really don't know how should I prove my innocence but I just want to convey the codeforces administration that your system is really flawed and is causing serious problems with even those giving it all in it that too honestly to improve. I will not come back to the platform again. I don't know if anything has happened to the account or what. But i don't think this is acceptable. I am really depressed right now with the flawed detection system you guys have built.

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

Hello N29, __rose, soullless

My code https://mirror.codeforces.com/contest/2149/submission/340473393 has been flagged for the similarity it contained for the other codes. The question was literally similar to a leetcode question i solved earlier and all the code i've written was in my local vscode setup. I had the quickest A-E solves than anyone in the list my code is being compared with and i believe it is a mere coincidence. I'd never do anything which hamper the competitive integrity of codeforces coz i love the sport a lot myself

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

I have received a notification that my submission for problem 2149E (https://mirror.codeforces.com/contest/2149/submission/340450859) has been flagged for similarity. I would like to clarify that this is a misunderstanding.

This problem is essentially a standard sliding window (two pointers) template problem. There is a very similar problem on LeetCode with the same core idea:

https://leetcode.cn/problems/subarrays-with-k-different-integers/

The solution approach is well-known and widely shared in public resources long before this contest. Many participants likely used the same standard technique independently.

I confirm that I did not share my code with anyone, nor did I view or copy anyone else's code during the contest. The similarity arises solely from the fact that this is a classical algorithmic pattern with a natural and common implementation.

I kindly request a re-evaluation of this case. Thank you for your understanding and fair judgment.

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

Hello Codeforces Team,

I am writing regarding my submission (ID 340465256) for Contest 1054 Div3, Problem E.

The submission was flagged for similarity with other solutions. I want to clarify that this is due to the use of a well-known algorithm used for the problems similar to "Subarrays with k distinct elements". which I had already implemented months ago on LeetCode (Problem 992). My Codeforces submission reused that standard logic with minor adjustments to fit the problem statement.

I did not copy from anyone else during the contest, nor did I share my solution with anyone.

Proof of prior work: - LeetCode problem: https://leetcode.com/problems/subarrays-with-k-different-integers/ - My original submission published months before the contest: https://leetcode.com/problems/subarrays-with-k-different-integers/submissions/1665131757/

I kindly request you to review this coincidence and consider it as a legitimate implementation of a standard algorithm.

Thank you for your time and understanding.

Best regards,
Jithesh Reddy
[Handle:- Jithesh_Reddy]

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

Subject: Clarification Regarding Solution Coincidence for Problem 2149E

Dear Codeforces Team

I recently received a warning stating that my solution for Problem 2149E (Submission ID: 340495648, username: vansh-707) significantly coincides with several other submissions, which is considered a rules violation. I want to sincerely clarify my side and assure you that I had no intention to violate any rules or share my solution.

During the contest, I encountered an issue with my local development setup. I typically use VSCode with the Codeforces Companion extension for compiling and testing solutions. However, due to a new antivirus program on my system, I began receiving a "STGREM" error while attempting to execute code. This disrupted my ability to test locally.

As an alternative, I used the Programmiz Online Java Compiler to test my solution against sample test cases. I was unaware that using this platform could potentially make my code publicly accessible. I now understand that some online compilers may store or expose submitted code unless explicitly set to private, which might have unintentionally led to code leakage.

I did not share my solution with anyone.

I was not aware that using an online compiler like Programmiz could result in my code being publicly accessible.

Any overlap with other submissions was purely unintentional and likely due to the above-mentioned exposure.

I now understand importance of using only trusted, private environments during contests. I will strictly avoid using any online compilers or platforms that might risk exposing code in the future.

I have participated in 37 contests in total in a span of 8 months and as you guys can see my growth as a beginner i have struggled in many contest and also managed to get good ranking in some contest.

I kindly request you to take this context into consideration while reviewing my case.

Thank you for your understanding

Warm regards, vansh-707

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

Hello Codeforces, I have received a notification that my submission for problem 2149E (https://mirror.codeforces.com/contest/2149/submission/340465979) has been flagged.

The question is basically the most commonly found pattern questions based on the sliding window, which can be found on leetcode. So since I am used to this pattern, implementation in the way that I had done, was the most intuitive, and I was used to it. The following are the leetcode questions: https://leetcode.com/problems/subarrays-with-k-different-integers/description/ https://leetcode.com/problems/binary-subarrays-with-sum/description/ https://leetcode.com/problems/count-number-of-nice-subarrays/description/ https://leetcode.com/problems/number-of-subarrays-with-and-value-of-k/description/ and many more Basically, the technique of using sliding window, but for finding at most k, and then at most k-1 and then subtracting to get exactly k. This algorithm is pretty common, so similarity is based upon mere coincidences, and re-evaluation should be done to give a fair judgment.

I ensure that I have never copied or used any unfair means to write any code. The similarity is all because of its too basic, standard algorithmic nature.

I kindly request you to re-evaluate and give a suitable judgment regarding the same

Thanking you, Solandra

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

Hello,

My solution 340473928 for problem 2149C has been marked as coinciding with several others. I would like to clarify that I did not share my code with anyone nor did I copy from others. I worked on the problem independently.

It is possible that the similarity occurred because the problem has a standard approach and many participants may have ended up with similar implementations. I also did not use any public code-sharing platform during the contest.

I kindly request you to review my case. I assure you that I respect the rules of Codeforces and will be careful in future contests to avoid any unintentional issues.

Thank you for your understanding.

— Xyra

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

Hello, I received a plagiarism warning for my submission 340452416 in Contest 2149.

I want to clarify that my solution is fully original and not shared with anyone. The reason it resembles other submissions is that it is based on a problem I solved earlier on LeetCode: Subarrays with K Different Integers (submitted on Apr 10, 2025, 16:53 under my account Gaurav Kumar).

Both solutions use the “at most k minus at most k-1” sliding window technique. The similarities occur because I reused the algorithmic idea I had already implemented and understood from my prior LeetCode practice.

Differences between the submissions: The Codeforces problem adds range parameters l and r, which are not present in the LeetCode problem. Minor differences in variable names (freq vs. mp, res vs. cnt) and data types. The core approach is the same because I had already practiced and solved the corresponding LeetCode problem before the contest. I did not share my code with anyone.

Here is a screenshot of my LeetCode submission:
LeetCode submission

I hope this clarifies the situation. Thank you for your understanding.

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

Hello Codeforces team, During the contest I submitted three different solutions. Two of them got Wrong Answer and only the last one was accepted, which shows that I was trying to solve the problem myself.

First submission (WA): [https://mirror.codeforces.com/contest/2149/submission/340427928]

Second submission (WA): [https://mirror.codeforces.com/contest/2149/submission/340477792]

Final submission (Accepted): [https://mirror.codeforces.com/contest/2149/submission/340479653]

I kindly ask you to understand my situation and review my case. Thank you.

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

Hello,

This is regarding my submission 340487181 for 2149E - Hidden Knowledge of the Ancients — Hidden Knowledge of the Ancients which was flagged with “skip”.

My solution was based on the well known LeetCode problem Subarrays with K Different Integers https://leetcode.com/problems/subarrays-with-k-different-integers/submissions/ which has been solved by hundreds of thousands of users. The approach I used was very basic and standard. I only implemented the same method that I had already solved for that LeetCode problem with a small adaptation to count subarrays within the length range [l, r].

I want to clarify that I did not use any unfair means or external help to solve this problem. The implementation was just to do the leetcode problem which i had already solved.

https://leetcode.com/problems/subarrays-with-k-different-integers/submissions/1669955420 Solved problem back in june.

I kindly request the admins to review this flag.

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

Hello,

I'm writing to explain the plagiarism flag on my solution for Problem E — Hidden Knowledge of the Ancients.

My Handle: SamriddhiDubey2908 Problem: 2149E My Submission ID: 340485973 Coinciding Submission: jyotpandya1512/340446435

The reason my code is so similar to jyotpandya1512's is that we both used the same standard algorithm, which is the most efficient way to solve this problem.

The solution uses a sliding window (two-pointers). To count subarrays with exactly k distinct items, the standard "trick" is to find the subarrays with at most k and subtract those with at most k-1. It's a textbook pattern in competitive programming. The most famous example is the LeetCode problem "Subarrays with K Different Integers" (992). Many public tutorials and videos cover this exact technique. The logic requires two pointers and two HashMaps, so there aren't many ways to write it differently besides changing variable names.

I hope this explains that the similarity is due to a standard algorithm learned from public resources, not plagiarism.

Thanks for taking the time to review this.

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

Dear N29, __rose, soullless

I understand the seriousness of rules regarding solution originality and code sharing.

I would like to clarify that I solved problem 2149D locally in my own IDE. I did not copy, share, or discuss my solution with any other participant, and I did not upload my code to any public or semi-public platforms such as ideone.com. I am committed to fair competition and have always written my solutions independently.

I acknowledge that sometimes similar implementations may arise, especially for standard algorithms or well-known approaches. If required, I can provide any artifacts or files (such as IDE logs, time stamps, local build history, etc.) to demonstrate my workflow and confirm that there was no intentional or unintentional code sharing on my part.

Further, I want to notify that, my submission 340425618 is fully original and I have not shared the solution with anyone.

The reason it might resemble with submission 340488631 is that, it is based on a problem I solved earlier, from StackOverflow: Given an array of 0 and 1, find minimum no. of swaps to bring all 1s together (only adjacent swaps allowed)

Differences between the problems: The Codeforces problem is an advanced version, containing 'a' and 'b', where I need to find the minimum swaps needed either to bring all 'a' to the median or all 'b' to the median, considering the array to be circular array. Meanwhile StackOverflow problem uses array of 0 and 1, brings just 1 to the median positions.

The approach is the same because I had already practiced and solved the corresponding StackOverflow problem before the contest. I did not share my code with anyone.

I have attached IDE logs for the reference. I use the same file for all the contests / update the solutions on them. As it can be seen, the file was last saved on the day of contest.

Further, I had made the submission at the timestamp 2025-09-25 18:06:45, meanwhile the other submission was done at the timestamp of 2025-09-25 19:19:55, that is, 1 hour 13 minutes after my submission. Even the compiler versions are different. I believe, it is a complete coincidence at best.

Please let me know if you need further details or clarification.

Thank you for considering my explanation.

Best regards, MindHawkIDE Timeline

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

    Hey N29, __rose, soullless,

    I would like to further add to my case, the solution pattern, of using main function for iterating over the testcases, then internally calling solve() method to run each testcase and using helper functions to do internal computations is common for me. You can refer to my previous submissions as well, I use the same pattern for all the questions. Also, I use highly definitive variable naming, to avoid confusion / follow best practices.

    These factors, further added to the similarities of an already standardized question.

    Therefore, I would like you to kindly reconsider the warning.

    Warm Regards,
    MindHawk

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

Dear Codeforces Team,

I recently received a notification regarding my submission [340449068] for problem 2149E, mentioning that it significantly coincides with submissions by other users. I would like to respectfully clarify my position.

I wrote my own code independently during the contest.

The solution to this problem is quite similar in approach to the well-known problem “Subarrays with K Distinct Integers” (https://www.geeksforgeeks.org/problems/subarrays-with-k-different-integers/1)(Geeks for Geeks/ Leet Code), and naturally, the implementations tend to look alike since there is a standard sliding window/hash map approach.

I do not know the other user(s) mentioned ([palak2210] etc.) and have never shared my code with anyone. It seems likely that we both arrived at similar logic since the standard approach is straight forward for this problem.

I kindly request you to re-examine this case, as I have not engaged in any kind of cheating, code sharing, or plagiarism. I am also careful not to use public IDEs (such as ideone.com) with default settings, so there is no chance of unintentional leakage from my side.

I truly value the platform and have been preparing sincerely for contests. I hope you will reconsider this flag, as it would be very discouraging for me to face penalties for a situation that is beyond my control.

Thank you for your time and understanding

Respectfully, Ashwin Reddy Aindla, Ashwin183

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

greater

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

Subject: Request for Reconsideration of Plagiarism Flag – Codeforces Round 1054 (Div. 3), 2149C - MEX rose

Hello __rose, soullless, Vladosiya, Wansur, abc864197532, ImDMka, [user:xxqqdqqqc], Away_in_the_heavens, Hagry, Dif1rent, APMAH, [user:sahuan], thespace, [user:ib], Batyi-A-019-28, HorridBear, Romakolesn, kartikchauhan189, Erbolat-R-019-28, Yozhik, [user:Fadallah], MikeMirzayanov, and Codeforces Admins,

I respectfully request your attention regarding a plagiarism flag I received for my solution 340432748 in 2149C - MEX rose of Codeforces Round 1054 (Div. 3).

It was reported that my solution coincided with 340430596 from tempp122. However, I want to clarify the following points:

This is the only submission where such an issue has occurred. None of my other codes in this or any other round match with anyone else’s.

I have no connection or communication with tempp122. I do not know them at all.

I genuinely wrote my solution myself, independently, during the contest.

I noticed (and have screenshots) that tempp122 uses different templates across different problems, which seems suspicious. My own submissions are consistent and reflect my own style. I am also sharing proofs of screenshots in my drive link: https://drive.google.com/drive/folders/1JcjV281D0S39lmo0Slhx2YIeRNdNNYOO?usp=drive_link

I fully understand the importance of integrity on Codeforces and I respect the anti-plagiarism measures. But in this case, the similarity is pure coincidence and not intentional plagiarism.

I kindly request you to reconsider the plagiarism flag on my submission. Please forgive me if unintentionally something went wrong, but I assure you my code is my own work.

Thank you for your fairness and understanding.

Best regards, ads_17 Email: anantrocksntw99@gmail.com

Please re examine it if thats the case i have also submitted another submission during the contest

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

Please reconsider of your decision to roll back my rating in latest div3 i wrote my genuinely and no connection with tempp122 Have a look codeforces admin i have no interaction of cheating i would have yo increase my rating i would i done it previously . Please look into this matter. I genuinely wrote the code on my own and you can check all other my code please avoid skipping my solution

@__rose @soullless @MikeMirzayanov Regards ads_17 Email anantrocksntw99@gmail.com

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

i received a plagiarism notification for my submission 340430087 in problem E.
i would like to clarify that I did not share my code with anyone, and i didn't copy it from any external source. for example: i only use my template on every code, for example: //@THANDUCBAO //codeforces: ducbao_ //atcoder: ThanDucBao //topcoder: ducbao_

include <bits/stdc++.h>

include

include <time.h>

define int long long

define endl '\n'

define BIG __int128

define mod 1000000007

define INF 1e18

define NINF -1e18

template<class A, class B> bool maximize(A &x, const B &y) { if (x < y) { x = y; return true; } return false; } template<class A, class B> bool minimize(A &x, const B &y) { if (x > y) { x = y; return true; } return false; } using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int R(int l,int r){ return uniform_int_distribution(l,r)(rng); } void sinh(){ int n=R(1,1000000000); cout<<n<<endl; } The solution was fully written by myself during the contest. i understand that sometimes solutions may look very similar if participants follow the same natural approach.
I kindly ask you to reconsider my case.
I respect the rules of Codeforces and will continue to compete honestly and fairly.

Thank you very much for your understanding.

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

Dear Codeforces, I recently received an email that my solution for C and D the contest(1054 Div 3) 340411979 for the problem 2149D and 340415052 for the problem 2149C coincides with some other participants. I have not used any public online platform for writing or copying the solutions. I used VS code on my local PC to write and test the solution I have added screenshots for the same showing that the last edited time corresponds with the submission times on Codeforces. I have added the explanation for the questions as well. I would also like to add that the template that i have followed for this solution is similar to my previous submissions as well.

2149C solution:solution for C 2149C properties:(https://drive.google.com/file/d/1QhiFlJQYac5MlxPyUnUhFTglfNRMPtKk/view?usp=sharing)

2149D properties:properties solution D

2149 D:solution for D

2149 D: I essentially used a greedy approach to move all the similar characters towards the mid position of the same character as this would minimize the cost of moving the characters from both sides, we try to put all the similar characters to the middle and have the other character chunk to the front and the end to give the minimum cost. We iterate the solution twice once assuming that the middle character is ‘a’ and the other time ‘b’ and the answer will be the minimum cost of these two.

2149C: MEX is essentially the minimum non negative integer that is not present in the array therefore for k to the MEX of an array 0 …k-1 will have to be present in the array hence if any of the number from 0 to k-1 are missing in the array some elements will have to be replaced to accommodate them . For each combination of n and k for each array will have a unique answer. In my code I have a vector freq that stores the frequency or count of each element and missing is the number of numbers from 0 to k-1 that are not present in the array. If k is n then the answer would be the number of missing elements and if k<n then the answer would be the maximum of the number of missing elements and the freq[k] as we can verify through some test cases.

I kindly request you to review this request again and consider my solution.

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

Hello,

I received a notification that my solution for problem 2149D coincides with other users’ submissions. I would like to clarify that I wrote my solution independently during the contest. I did not share my code with anyone, nor did I copy from others.

It is possible that the similarity occurred because this problem has a standard/common approach, and my implementation may look similar to others who followed the same idea. I respect the contest rules and always try to compete fairly.

Please kindly review my case again. I am ready to provide my thought process if needed.

Thank you for your understanding.

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

Hello Codeforces Team,

I received a warning for solution 340481538 (Problem 2149E) due to similarity with other submissions. I want to clarify that my approach was based on the well-known sliding window technique used in LeetCode 992 — Subarrays with K Different Integers, which was published long before the contest.

Because of that, as the core logic is standard and widely practiced. I did not share my code during the contest, and I used a local editor to avoid any leakage.

I kindly request a review of my case. I respect the rules and will take extra care in future contests.

— prathamkr147

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

I received a warning for solution 340502629 (Problem 2149E) due to similarity with other submissions. I want to clarify that my approach was based on the well-known sliding window technique used in LeetCode.This kind of problems have a problem set in leetcode china([https://leetcode.cn/discuss/post/3578981/ti-dan-hua-dong-chuang-kou-ding-chang-bu-rzz7/] in section 2.3.3).this kind of problem is called exactly shaped sliding window.

Because of that, as the core logic is standard and widely practiced. I did not share my code during the contest, and I used a local editor to avoid any leakage.

I kindly request a review of my case. I respect the rules and will take extra care in future contests.

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

Dear Codeforces Team,

I received a plagiarism warning for submission 340440247 (Problem 2149C) and 340486949(2149D ), but I assure you the code was written entirely by me. I did not share it publicly, upload it to any online IDE, or send it to anyone. I worked alone and did not use any shared environment.Moreover, I got Wrong answer for 2 times in that question .So, I think this is enough to show my attempt to solve that problem

May be the solution was based on a standard technique and may look similar to others who used the same logic. I did not copy or share my code.Moreover, I dont even know the other guys whoose code matched with me significantly .

I understand the seriousness of this issue and am willing to cooperate fully. I kindly request a review of my case and please check my code manually once again

Thank you, Md_Mahin

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

Subject: Appeal re plagiarism flag — submission [340485399] for [Problem 2149E] Dear Codeforces team and round coordinators, An automated message was sent to me that my submission [34048539] for [2149E] has considerable concordance with submissions with the IDs (beardly/340475079, Skylight_ 422/340481158, IamKeviN69/340481986, Vimlendu2003/340485399, AdelO_mcc/340502599), although one of the Id among them is mine itself as Vimlendu2003, cited in the notice. I would like to put forth an explanation and request some leniency on blocking my account. The problem was solved by me in the actual contest. While testing on an online compiler/paste service, I accidentally left my code public. Now, I do realize that this was a violation because code exposure can lead to a sudden presence in the realm of other contestants. So to be clear: I never intended to share the code with anyone, nor was it handed over to me by anyone. This was my slip-up, and I take full responsibility for the accidental leakage. The following measures have been adopted in order to ensure that such an incident never occurs again: 1. I will not be using any paste/online judge service for contest code. 2. My tools have been set by me for only private/local testing by default; 3. I have gone through the Codeforces rules (blog entry 8790) for a better understanding. I accept fully any penalties given by the jury in accordance with the rules (e.g., disqualification of submission/rating rollback), and I respectfully request that my account not be blocked as the action was unintentional and the cause has been eliminated. Codeforces means much to me, and I want to stay fair and continue learning in future rounds.

Thank you for your time and consideration.

Vimlendu Sharma/Vimlendu2003

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

i am confused about why my method is wrong with problem D.here is my method translated by grok(my english is bad)

Below is a clear and concise English translation of your approach, tailored for posting in a Codeforces comment section. It describes your greedy strategy of processing the string from both ends, assigning characters to left or right clusters, and addresses the issue with handling the middle character for odd-length strings. The tone is suitable for seeking help in a competitive programming community.


My Approach for the Problem

I'm trying to solve the problem of finding the minimum number of adjacent swaps to make all occurrences of either 'a' or 'b' form a single contiguous block in a string ( s ) of length ( n ). Here's my approach:

  1. Two Cases: The goal is to either gather all 'a's into one contiguous block (by moving 'b's) or gather all 'b's (by moving 'a's). I compute the minimum number of swaps for both cases and take the minimum.

  2. Two-Pointer Greedy Strategy:

  • I use two pointers, l (starting from the left) and r (starting from the right), moving towards the middle.
  • For each character at s[l] and s[r], I treat it as an "obstacle" and decide whether to move it to a left cluster or a right cluster, choosing the option with lower cost (fewer swaps).
  • I maintain counters:
    • la and ra: number of 'a's in the left and right clusters, respectively.
    • lb and rb: number of 'b's in the left and right clusters, respectively.
    • ansa: total swaps needed to move all 'a's to gather 'b's.
    • ansb: total swaps needed to move all 'b's to gather 'a's.
  1. Cost Calculation:
  • For s[l] = 'a': Move it to the left cluster (cost: l - la) or right cluster (cost: n - 1 - l - rb). Choose the smaller cost and update ansa and la or ra.
  • For s[l] = 'b': Move it to the left cluster (cost: l - lb) or right cluster (cost: n - 1 - l - ra). Update ansb and lb or rb.
  • Similarly for s[r], with costs adjusted for the right side (e.g., r - lb or n - 1 - r - ra for 'a').
  • The costs represent the number of positions the character needs to move, assuming clusters are forming at the ends.
  1. Handling Odd-Length Strings:
  • If ( n ) is odd, l and r meet at the middle character (l == r). I process this character once, choosing to move it to the left or right cluster based on the smaller cost.
  1. Final Answer:
  • Output min(ansa, ansb) as the minimum swaps needed.

Issue: I initially used while (l <= r), which caused the middle character in odd-length strings to be processed twice, leading to incorrect results. I fixed this by using while (l < r) and handling the middle character separately when l == r. However, my code still fails on some test cases (possibly due to incorrect cost calculations or edge cases). Can someone help identify what's wrong with my approach or suggest improvements?

Sample Code (simplified): cpp #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; string s; cin >> n >> s; int l = 0, r = n - 1; int la = 0, ra = 0, ansa = 0; // For moving 'a' to gather 'b' int lb = 0, rb = 0, ansb = 0; // For moving 'b' to gather 'a' while (l < r) { if (s[l] == 'a') { if (l - la > n - 1 - l - rb) { ansa += n - 1 - l - rb; ra++; } else { ansa += l - la; la++; } } else { if (l - lb > n - 1 - l - ra) { ansb += n - 1 - l - ra; rb++; } else { ansb += l - lb; lb++; } } if (s[r] == 'a') { if (n - 1 - r - ra > r - lb) { ansa += r - lb; la++; } else { ansa += n - 1 - r - ra; ra++; } } else { if (n - 1 - r - rb > r - la) { ansb += r - la; lb++; } else { ansb += n - 1 - r - rb; rb++; } } l++; r--; } if (l == r) { if (s[l] == 'a') { if (l - la > n - 1 - l - rb) { ansa += n - 1 - l - rb; ra++; } else { ansa += l - la; la++; } } else { if (l - lb > n - 1 - l - ra) { ansb += n - 1 - l - ra; rb++; } else { ansb += l - lb; lb++; } } } cout << min(ansa, ansb) << endl; } return 0; }

Questions: - Is my cost calculation (e.g., l - la or n - 1 - l - rb) correct for counting adjacent swaps? - Am I missing any edge cases or misinterpreting the cluster positions? - Should I switch to a different approach, like sliding window or median-based?

Any help or suggestions would be greatly appreciated!


This translation captures your approach clearly, highlights the issue with the middle character, and asks specific questions to invite feedback from the Codeforces community. It includes a simplified version of your code for reference. You can post this directly in the comments section. Let me know if you want to tweak the wording or add more details!

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

Subject: Clarification Regarding Solution Coincidence for Problem 2149E

Dear Codeforces Team,

I recently received a notification regarding my submission [340449068] for problem 2149E, mentioning that it significantly coincides with submissions by other users. I would like to respectfully clarify my position.

I wrote my own code independently during the contest.

The solution to this problem is quite similar in approach to the well-known problem “Subarrays with K Distinct Integers” (https://www.geeksforgeeks.org/problems/subarrays-with-k-different-integers/1)(Geeks for Geeks/ Leet Code), and naturally, the implementations tend to look alike since there is a standard sliding window/hash map approach.

I do not know the other user(s) mentioned ([palak2210] etc.) and have never shared my code with anyone. It seems likely that we both arrived at similar logic since the standard approach is straight forward for this problem.

I kindly request you to re-examine this case, as I have not engaged in any kind of cheating, code sharing, or plagiarism. I am also careful not to use public IDEs (such as ideone.com) with default settings, so there is no chance of unintentional leakage from my side.

I truly value the platform and have been preparing sincerely for contests. I hope you will reconsider this flag, as it would be very discouraging for me to face penalties for a situation that is beyond my control.

Thank you for your time and understanding.

Respectfully, Ashwin Reddy Aindla, Ashwin183