Vladosiya's blog

By Vladosiya, history, 15 months ago, translation, In English

Hello! Codeforces Round 1027 (Div. 3) will start at May/26/2025 17:35 (Moscow time). You will be offered 7 problems with expected difficulties to compose an interesting competition for participants with ratings up to 1600. However, all of you who wish to take part and have a rating of 1600 or higher, can register for the round unofficially.

The round will be hosted by rules of educational rounds (extended ICPC). Thus, solutions will be judged on preliminary tests during the round, and after the round, it will be a 12-hour phase of open hacks. After open hacks all accepted solutions will be rejudged on successful hacks.

You will be given 7 problems and 2 hours and 15 minutes to solve them.

Note that the penalty for the wrong submission in this round is 10 minutes.

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.

Problems have been created and written by our team: myav, Gornak40, ibraevdmitriy and Vladosiya.

We would like to thank:

  1. MikeMirzayanov for Polygon and Codeforces platforms.

  2. imirdy for red testing.

  3. Be_dos, KseniaShk, pengin_2000, Eugene312 for yellow testing.

  4. Kmes for purple testing.

  5. RobinFromTheHood, AlphaMale06, Kosya, itz_pabloo, umezo, donovilia2007, l-_-l for blue testing.

  6. rcht, zoro2000, ne_justlm, IceHydra for cyan testing.

  7. jbrenorv for green testing.

Good luck!

UPD: Editorial is out!

  • Vote: I like it
  • +156
  • Vote: I do not like it

| Write comment?
»
15 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

First unrated Div3 :D

»
15 months ago, hide # |
Rev. 2  
Vote: I like it +30 Vote: I do not like it

Finally after 2 years on cf, i am able to post this picture!

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Interactive problems.. Where?

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Overlaps with NAC :(

»
15 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Yeaaaah! Vladosiya Div3 rounds are back <3

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Have we stopped the authors snap trend? I don't see it anymore in recent blogs.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Is there any interactive problem jn the today contest

»
15 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

I wish we could have a

^-^
»
15 months ago, hide # |
Rev. 2  
Vote: I like it +1 Vote: I do not like it

Thanking everyone working behind the scene to make these contests possible. Hoping for a positive delta ♥

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good luck! And get postive $$$\Delta$$$.

»
15 months ago, hide # |
 
Vote: I like it +29 Vote: I do not like it

Please tell me I'm not the only one who found the B problem harder than the C problem.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

submitted F 10s before and still Wrong answer :(((

»
15 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

I enjoyed the contest, especially problem $$$F$$$

Thank you for this contest ^_^

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    what did you do to get the minimum, because I thought of bitwise dp but it was to late to implement it at that moment?

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it +1 Vote: I do not like it

      well, I used normal dp

      dp[x] = min(dp[y] for each y such that y = x / z and z <= k) + 1

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Can you please tell about the your dp state. What does dp[x] mean ?

        • »
          »
          »
          »
          »
          15 months ago, hide # ^ |
           
          Vote: I like it +1 Vote: I do not like it

          here is the code for my dp

          code

          dp[x] is the minimum number of operations needed to reduce x to 1

          and each time, I will do like what I mentioned in the previous comment

          I will take all the divisors of x, and if a divisor is less than or equal to k, I can take its dp value, I will take the minimum between all possible values, then my dp[x] is this minimum value + 1

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        what's the time complexity of it?

        • »
          »
          »
          »
          »
          15 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          I'm not sure what is its exactly time complexity

          because for each number $$$x$$$, it will go to its divisors and so on, I don't know if there is an approximated time complexity for it or no

          • »
            »
            »
            »
            »
            »
            15 months ago, hide # ^ |
             
            Vote: I like it 0 Vote: I do not like it

            you just guessed it would fit under time limit?

          • »
            »
            »
            »
            »
            »
            15 months ago, hide # ^ |
            Rev. 2  
            Vote: I like it 0 Vote: I do not like it

            There can be cuberoot(n) divisors of a number n, so tc should be n^2/3. Thanks for the help. Crazy consistency orz

            • »
              »
              »
              »
              »
              »
              »
              15 months ago, hide # ^ |
               
              Vote: I like it 0 Vote: I do not like it

              How did u get n^2/3? Shouldn't it be n^4/3?

              • »
                »
                »
                »
                »
                »
                »
                »
                15 months ago, hide # ^ |
                 
                Vote: I like it 0 Vote: I do not like it

                (n ^ (1/3)) ^ 2 = n ^ (2 * 1/3) = n ^ 2/3

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  15 months ago, hide # ^ |
                   
                  Vote: I like it 0 Vote: I do not like it

                  no each number can have upmost n^1/3 divisors and we can have any any number while transitioning?or is it that we can have upmost n^1/3 numbers while transitioning?

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  15 months ago, hide # ^ |
                   
                  Vote: I like it 0 Vote: I do not like it

                  we'll have only the divisors of n at each step which can be atmost n^1/3.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  15 months ago, hide # ^ |
                   
                  Vote: I like it 0 Vote: I do not like it

                  how it is n^(2/3) why not n^(1/3)?

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  15 months ago, hide # ^ |
                   
                  Vote: I like it 0 Vote: I do not like it

                  See the code, we are iterating over all the divisors for a given divisor. A for loop in a recursive function or equivalently 2 nested for loops

            • »
              »
              »
              »
              »
              »
              »
              15 months ago, hide # ^ |
               
              Vote: I like it 0 Vote: I do not like it

              Thank you ^_^

              first time to know about this time complexity, thank you for sharing it!

  • »
    »
    15 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    Can u tell me for which test case my code will not work , problem F small operations 321700977

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      you have two things wrong in your code:

      • you check only the maximum divisor of only number $$$x$$$ or $$$y$$$, while you have to check both of them, you can fix it by changing these two lines:
                  mxm = (pfx.size()>0)?pfx[pfx.size()-1]:mxm ;
                  mxm = (pfy.size()>0)?pfy[pfy.size()-1]:mxm ;
      

      into these two lines:

                  mxm = max(mxm, (pfx.size()>0)?pfx[pfx.size()-1]:mxm) ;
                  mxm = max(mxm, (pfy.size()>0)?pfy[pfy.size()-1]:mxm) ;
      
      • you can't use greedy to find the minimum number of operations, you must use $$$dp$$$ for this
      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        okay thanks

        any reason why i can't use greedy , i didnt get

        • »
          »
          »
          »
          »
          15 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          imagine the case where you have to these numbers in your divisors and you will use them

          2 2 3 3

          and $$$k$$$ is equal to 6

          if you used some greedy, like multiplying from the end, or from the beginning, you won't get the correct answer, will end always with 3 operations, but with dp, you will get 2 operations

          it was just a little example, there are more examples where greedy doesn't work

          if you used greedy to multiply the end with beginning, you will get WA on test3, so, use dp for it

          • »
            »
            »
            »
            »
            »
            15 months ago, hide # ^ |
             
            Vote: I like it 0 Vote: I do not like it

            In greedy, if i take the largest possible value that can fit and keep doing it. I can pass this case in greedy. Can you tell me a test case where this idea fails?

            I got WA in TC 3 but cant figure out any case where it fails.

            • »
              »
              »
              »
              »
              »
              »
              15 months ago, hide # ^ |
               
              Vote: I like it 0 Vote: I do not like it

              What do you mean by taking the largest value?

              • »
                »
                »
                »
                »
                »
                »
                »
                15 months ago, hide # ^ |
                 
                Vote: I like it 0 Vote: I do not like it

                2, 2, 3, 5, 13 k = 42

                Here in the first operation, I will take 13, and then I won’t take 5 as the product will exceed k, so I will take 3 instead. I won’t be able to take any more numbers in this operation.

                In the second iteration, I will take 5, 2, 2.

                My idea is: I will iterate through the array multiple times from backwards. Each time, I will take a value if the product doesn't exceed k, otherwise I will skip it and try to pick the next one.

                In which case it fails?

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  15 months ago, hide # ^ |
                   
                  Vote: I like it +3 Vote: I do not like it

                  For example, if you have:

                  k = 28,

                  7, 3, 3, 3, 2, 2.

                  Your strategy would give as an answer:

                  7,3; 3,3,2; 2

                  but the best is:

                  3,3,3; 7,2,2

»
15 months ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

C and E were nice, B and D were gay. Thanks for the round.

»
15 months ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

The lesson I learned from this is not to participate in contest when I have a fever :(

»
15 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

can someone confirm if there is a way to solve F like this?

let the prime factorization of $$$ x = {p_1}^a * {p_2}^b * ..... * {p_n}^c $$$

and $$$ y = {q_1}^m * {q_2}^n * .... * {q_l}^o $$$

Then suppose that none of the prime factor $$$ \gt k $$$, then we need to divide $$$ x $$$ by some factors and multiply by some. Let those be $$$ div$$$ and $$$mul$$$. Now, the problem is just to find minimum number of subsets of both these new variables such that in such subset $$$ product \lt = k $$$ but idk how to do this step. can someone help me?

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    I solved it like that. Think about shortest paths and a careful implementation.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    You can use djikstra , suppose you are at starting node 1, and ending node is "div". The factors of "div" (which are less than k) will be the edges of the graph, so you can use djikstra to find minimum number of operations required to move from starting node to ending node using these edges.

»
15 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Man, idk why i am getting wrong answer on test3 in F. wasted 10mins on debugging D where i was forgetting to take max with last index which was outside loop. I think i will be on edge of becoming expert :(.😭😔😫

Nice round though

  • »
    »
    15 months ago, hide # ^ |
    Rev. 3  
    Vote: I like it 0 Vote: I do not like it

    Me too, but then I realize that greedy was imcorrect, you should implement dynamic programming.

    My submission 321571955 here.

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      can you explain your dp solution..thnkx

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        We want to make $$$x$$$ by mul and div operations to $$$y$$$, so reduce the problem to make $$$x, \, y$$$ to an identical integer by only div operations.

        So let's precalculte the factors of integers not exceed $$$10^6$$$, $$$d(10^6) = 240$$$ (here $$$d(n)$$$ means number of factors of the number with the most factors which not exceed $$$n$$$). We only try to use factors of $$$x$$$ to reduce it.

        I use a dynamic programing which is like BFS, that can be convenient to finish dp. And at last, we only need to enumerate all the factors of $$$x$$$ to see if $$$y$$$ can be reached.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why was this contest not rated for me?

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What is the intended solution for problem F? My solution takes a bit too long to run.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    It is Sieve of Eratosthenes only, but you have to sort the queries first and then build up your sieve as $$$k$$$ increases.

  • »
    »
    15 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it +14 Vote: I do not like it

    Say gcd(x, y) = g, Then the problem reduces to finding the same answer for (x/g, y/g), say x1, y1

    Additionally, since x1 and y1 are co-prime, we just need to find a way to remove all of x1 by division and multiply all of y1 by multiplication.

    So if we define a function, f(x) => minimum moves to make x from 1 through repeated multiplication by a number <=k, we just need to find f(x1) + f(y1)

    Now for any number X, it has ~ (X^1/3) divisors.

    So you can run a brute force dp to try to build X based on the current number and the next number you want to reach to. This will give ~(N^2/3) time complexity per number.

    And since sum of all X and Y is less than 1e8, sum of their (2/3) powers will also be lesser than 1e8 which would fit the given time constraints.

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      can we do it with graphs?model nodes as numbers from 1 to max(x,y),and edges if transition is possible.I guess they will be of order zlogz where z=max(x,y) and then run dijkstra?

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Can we calculate f greedily instead of dp ? I mean for f(x) does dividing x to its biggest divisor (that is lower than or equal to k) always yield the optimal answer ?

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it +1 Vote: I do not like it

        The greedy idea will not work in the 7th input of sample cases itself.

      • »
        »
        »
        »
        15 months ago, hide # ^ |
        Rev. 2  
        Vote: I like it +3 Vote: I do not like it

        Yaa i guess I wrote a greedy solution, which is passing feel free to hack it, 321527163

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Not exactly, but I submitted a greedy solution that keep taking the prime factors of $$$x$$$ as long as their product is $$$\le k$$$. Just taking them in decreasing order is not optimal and failed test 3. But repeating this greedy a bunch of times with random orderings passes all tests. I think this might still be hackable though 321492564.

        • »
          »
          »
          »
          »
          3 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          I also have a greedy solution which takes the largest number <= k which also has the largest divisor of x and divide x by that number. id: 375359477

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      can you please break down how you calculated that N^2/3 time complexity?

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    bfs

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    If area==n-1, area++, is wrong, you assume the only way to get n-1 is 1*n-1, what if n-1==6 and you had 2*3=6, so area would have been min(3*3,2*4)=8

  • »
    »
    15 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    if(area == n — 1) area++;

    area++ should be done regardless and if(area == n-1) then area +=min(side1, side2) because this would increase either length or breath. here side1 and side2 are two sides of the rectangle formed.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    if the area is equal to $$$n - 1$$$, then you have to add $$$min((xmx - xmn + 1), (ymx - ymn + 1))$$$ to this area, not increasing the area value by 1

»
15 months ago, hide # |
 
Vote: I like it +15 Vote: I do not like it

For problem F, I reduced it to: 'Given a list of numbers, find the minimum number of groups such that the product of every number in each group is less than k.' But I found this problem hard any hints?

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    these were the possibilities I thought of, and one of them ended up AC: dp, shortest paths, greedy. Think about it.

  • »
    »
    15 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    https://cses.fi/problemset/task/1653

    But there is a way easier solution.

    Since I didn't come up with it myself, I won't explain it. Instead I'll just ping ludo. and tell him to explain it instead.

  • »
    »
    15 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it +2 Vote: I do not like it

    It's funny because this problem is NP-hard. I also thought of this but the case $$$2^{26}$$$ made me rethink my approach. Anyway, the idea is basically

    $$$dp(i) = 1 + min(dp(i / d))$$$

    Where $$$d$$$ is a divisor of $$$i$$$ that is not 1 and is ≤ $$$k$$$. Also the base case $$$dp(1) = 0$$$.

    • »
      »
      »
      15 months ago, hide # ^ |
      Rev. 3  
      Vote: I like it +5 Vote: I do not like it

      Btw the reason why this problem has an easier solution is because there is a small number of distinct states. For example, consider the bin-packing variation where we take the sum of elements (instead of product). You can encode the state of the problem as a frequency table of the numbers we have (using a hash map, for example). Then the number of distinct states are $$$\prod_i freq_i + 1$$$. As all numbers may be distinct we have up to $$$2 ^ n$$$ states. In the multiplication case we have exact same scenario, but as the product of everyone $$$\leq 10^8$$$ it follows that we can't have a very large value of $$$\prod_i freq_i + 1$$$. In fact, for this particular problem, the elements you want to separate in bins are the prime factors of some number $$$n \leq 10^8$$$, so it follows that the number of distinct states is exactly equal to the number of divisors of $$$n$$$, which is $$$\leq n$$$.

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      how is it NP hard? i think the time complexity of the dp solution with the states and transition you mentioned is nlogn

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it +8 Vote: I do not like it

        n*n^(1/3)

      • »
        »
        »
        »
        15 months ago, hide # ^ |
        Rev. 2  
        Vote: I like it +8 Vote: I do not like it

        the bin packing problem is NP hard ($$$n \cdot 2^n$$$ using dp), but the number of prime factors of a number is logarithmic ($$$log n$$$), so together the log cancels the exponential ($$$\log n \cdot 2^{(\log n)}$$$ => $$$n \log n$$$)

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    You can also solve it by DP on divisors in O(divisors ^ 2) my submission

»
15 months ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

ugh, in F for 40-50 minutes i thought we have to do SOS DP :(

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it +5 Vote: I do not like it

    same bro istg

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Pls tell your approach for F

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it +6 Vote: I do not like it

      my solution is kinda different first i do what everybody does ->>>

      Say gcd(x, y) = g, Then the problem reduces to finding the same answer for (x/g, y/g), say x1, y1

      Additionally, since x1 and y1 are co-prime, we just need to find a way to remove all of x1 by division and multiply all of y1 by multiplication.

      So if we define a function, f(x) => minimum moves to make x from 1 through repeated multiplication by a number <=k, we just need to find f(x1) + f(y1)

      now calculation of f(x) is different for me ->>>>

      first thing to note is that, we can do something greedy here, we can always choose such subsets of prime factors of x which when multiplied is <=k basically over all subsets, choose that subset which gives maximum product less than k. subtract that subset from total prime factors and repeat this process till factors are empty. this process will run atmost 20 times.

      but choosing a subset is 2^20, so this will be slow as sum of x can be up to 10^8

      but if we choose subsets recursively we can return early and not all 2^20 subsets will be checked,

      basically if k is large i.e., big subsets are created then we will repeat the process way less than 20 times and if k is small then we will return early not all 2^20 operations will be done. i don't have proof for this though. it might so happen someone create a test which would TLE idk.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Glad to know I wasn't the only one to try it, ended up spending way too long on it :(

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    How are you sure that 'F' will pass? I was thinking the same, but not sure it will pass or not.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    wait, that isnt the intended solutions? we could have up to log2(1e6) numbers that we need to multiply and divide with so that's at most 20 numbers and we can do bitmask dp on that? Is this not the solution?

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      but sum of x is upto 10^8 over all test cases.. it won't pass, also, i don't think there is any solution for SOS DP, if try that way, it will become set-covering problem, which is NP HARD. (though i am not so sure.)

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

F is basically https://cses.fi/problemset/task/1653 but instead of addition, it's multiplication

»
15 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I can see three 'greedy' tags on 2114C - Need More Arrays's tags lol

»
15 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Thanks, the problems were really fun!!

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

First rated contest.. Solved A and C but didn't pass test case 2 in problem B. Waiting for the tutorials..

  • »
    »
    15 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    Maximum amount of good pairs we can make is cnt_zeros/2 + cnt_ones/2. This should make sense.

    Minimum amount of good pairs we can make is abs(cnt_zeros — cnt_ones)/2. Why? Every bad pair is a 1 and a 0, so if cnt_ones > cnt_zeros, we will have cnt_ones-cnt_zeros left over, and we will have cnt_ones/2 good pairs.

    So, if k < minimum or k > maximum, the answer is NO.

    But, not all numbers of good pairs in [minimum, maximum] are possible. If we have the maximum amount of good pairs, we can only reduce it by multiples of 2. Why?

    To eliminate a good pair (say, two zeros), we need to find another good pair (of two ones) so the two zeros and two ones can be matched up. So, we can only eliminate good pairs 2 at a time, minimum and maximum always have the same parity.

    So, we need minimum <= k && k <= maximum && (k%2) == (maximum%2).

»
15 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Guys how MyBrainGotTLE able to hack codes so easily and fast of div 3 contests

»
15 months ago, hide # |
 
Vote: I like it +17 Vote: I do not like it

Hello! Thanks for the nice contest, I really liked the problems.

Anyways, I was wondering if somebody could hack my solution for problem F cause I figure it's just of the verge of not passing due to TLE: 321498835

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it +5 Vote: I do not like it

    Hi, your solution and mine (at the contest) are similar. It was some modify from adding to multiplying from a classic dynamic programming bitmask problem (minimum rides for lift) in the very popular book, competitive programming handbook. I pretty confidence that I will not be the only one using this solution alone :D. Sadly, this solution is not fast enough due to the sum of $$$N$$$ can reach $$$10^8$$$. Log constant will not let it pass.

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it +5 Vote: I do not like it

      Yep, a friend of mine hacked my solution, altho in general I think that if the time limit was like 4s instead of 3s it might have just passed. But yeah, all in all it was very stupid of me just to accept that solution even though I knew it was wayyy too janky.

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it +5 Vote: I do not like it

        if you do the same bin packing DP but with the multiplicity optimization it will very comfortably pass. see 321709533

»
15 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Hey there! I saw quite a few comments regarding the solution for F... infact I was also pinged here.

I had a different solution:

Firstly, note that for going from x->y it is equivalent to go from x->gcd and gcd->y Which is further equivalent to go from gcd -> x and from gcd -> y and thus from 1->x/gcd, 1->y/gcd

Now I will process the testcases offline. I go in increasing order of k. And a dp solution suffices, because the answer for a given number changes iff it is a multiple of k

Reading the code will give a better understanding Code : 321493342

Hope I was able to explain well and that this solution gave you a clearer understanding. But if you still have any doubts, do feel free to ask them!

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

can someone tell how to achieve y = 982800, x = 1 for k = 13 in just 6 ops. in problem F

»
15 months ago, hide # |
 
Vote: I like it +29 Vote: I do not like it

I was going through submissions to hack, and I received this warning:

"Recently, your account was used to crawl. Please change your password to prevent your account from being used for unauthorized activities."

I can't view submissions anymore. Is there a way I can get this permission back?

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Got stuck on F :(

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What is the indeed solution to F, i got hardstuck for so long.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    There are a lot of variants, but most stem from the fact that it's optimal to go from $$$x$$$ to $$$\text{gcd}(x, y)$$$ to $$$y$$$. This then involves somehow grouping up the prime divisors of $$$\frac{x}{\text{gcd}(x, y)}$$$ (and vice-versa with $$$\text{gcd}(x, y)$$$ to $$$y$$$, as, due to the available operations, it's symmetric) into groups such that the internal product of each formed group $$$\leq k$$$. Thus, what we end up trying to minimize is the number of such groups.

    I couldn't find a trivial way to do this, and one of the reasons why this packing problem isn't as straightforward is because of cases such as the following:

    $$$a = [2, 2, 2, 5, 5, 5],\, k = 10$$$

    (In this case, $$$a$$$ is the multiset of prime factors that compose $$$\frac{x}{\text{gcd}(x, y)}$$$). In this case, using a very greedy approach you'd get the following groups:

    $$$ [ (2, 2, 2), (5), (5), (5) ] $$$

    with a cardinality of 4. This is not optimal, as $$$ [ (2, 5), (2, 5), (2, 5) ] $$$ has a lower cardinality. Anyways, after trying a different greedy approach and failing miserably, I figured that some kind dp idea would work. The most obvious being bin-packing dp (see CSES dynamic programming section). However, I believe this is by far one of the slower approaches.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How do I solve proble? F,are there some similar problems of the same type?

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone tell me what is wrong with my solution to Problem E?


#include <bits/stdc++.h> #define ll long long #define vi vector<int> #define vb vector<bool> #define pii pair<int,int> using namespace std; void solve() { int N,x,y; cin >> N; vi v(N + 1), parent(N +1), m(N+ 1), M(N+ 1); vb visited(N+1, false); vector<vi> adj(N+1); for(int i = 1; i<= N; ++i){ cin >> v[i]; } for(int i = 1; i<N;++i){ cin >> x >> y; adj[x].push_back(y); adj[y].push_back(x); } queue<int> q; q.push(1); visited[1] = true; M[1] =m[1] = v[1]; while(!q.empty()){ int n = q.front(); q.pop(); for(const int& neighbor : adj[n]){ if(!visited[neighbor]){ visited[neighbor] = true; q.push(neighbor); m[neighbor] = min(v[neighbor], v[neighbor] - M[n]); M[neighbor] = max(v[neighbor], v[neighbor] - m[n]); } } } for(int i = 1; i<= N; ++i){ cout << M[i] << " "; } cout << endl; return; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { solve(); } return 0; }
»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Video editorial I made for D and E in case anyone is interested (will upload A-C later if I am motivated enough):

Problem D

Problem E

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Is $$$F$$$ SOS DP ?

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What's the idea behind G? Would appreciate some hints.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Basically, it's a matter of "what´s the maximum number of values I can use to create a value $$$v$$$ in the array?"

    Well, let's look at 8: ok, we could put 4 then 2 then 1 then 1. This would give us 8: but wait a second, just putting 1 1 1 1 1 1 1 1 would automatically give us 8. This happens because the following transformations occurs:

    1. $$$[1, 1, 1, 1, 1, 1, 1, 1]$$$
    2. $$$[2, 1, 1, 1, 1, 1, 1]$$$
    3. $$$[2, 2, 1, 1, 1, 1]$$$
    4. $$$[4, 1, 1, 1, 1]$$$
    5. etc

    Ok, could we use the same idea with 9? Well, we'd have to combine two equal values, but since 9 isn't divisible by 2, we can't do it! From this, we get the intuition that the answer (for each position) is related to how many times we can split the number $$$a_i$$$ into equal parts.

    Also, notice that the general construction that we have used basically implies that if for a certain value I have to use at least $$$l_i$$$ and at most $$$r_i$$$ operations to create it, then all the values in between should also be possible.

    There are a number of edge cases, but this is the main intuition. Hope this helps!

    • »
      »
      »
      15 months ago, hide # ^ |
      Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      Yeah, I was thinking along the same lines, and I tried to code it out. But I got wa on tc4. It seems like I am not handling the case properly when two adjacent indices have same bases (base is that number which we eventually get from equal parts division).

      In that case, if I am adding on the front/left, and let's say $$$a_{i-1}$$$ is greater than $$$a_i$$$, then what I assume is that I'll add $$$a_i$$$ from the base, and then I'll start from $$$a_i \times 2$$$ and add equal parts until it becomes $$$a_{i-1}$$$. Is my thinking on track?

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Well, I think the easier way to understand it would be by looking at the following case: let's say we have already set a 16 as $$$a_{i - 1}$$$ and we're not allowed to change it. Then, suppose the next position $$$a_i$$$ has to be 64. In this case, what happens is that we can't use the following pattern: $$$gen(64) = gen(32) + gen(16) + gen(8) + gen(4) + gen(2) + gen(1) + gen(1)$$$ (where $$$gen$$$ is the operation that generates the given value through some number of recursive calls). Specifically, we can't generate the 32 as our leftmost position because generating 32 involves generating 16 and 16, placing a 16 next to our previous 16 would mess it up (notice that reordering the generators wouldn't help). Thus, we just have to place a 32 there. So, it's equivalent to doing $$$r_i := r_i - gen(32) + 1$$$. Does that reasoning make sense?

        • »
          »
          »
          »
          »
          15 months ago, hide # ^ |
           
          Vote: I like it +5 Vote: I do not like it

          Yeah, this is more optimal. I was just adding $$$32, 32, 64, 128...$$$ and so on. I didn't realize we can just put a $$$32$$$ first to prevent merging with $$$16$$$, and then just continue with our $$$gen(32), gen(64), gen(128)...$$$ and so on.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

difficulty estimations

A — 800

B- 900

C — 900

D — 1300

E — 1500

F — 1900

G — 2200

  • »
    »
    15 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    For me E was easier than D. E was kind of standard, but D required a bit of thinking. Also, G and F were pretty close.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    listed difficulty:

    A: 800

    B: 900

    C: 1000

    D: 1400

    E: 1400

    F: 2000

    G: 2200

    you were pretty accurate

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

is it just me or was this div3 pretty easy? i managed to solve till E in an hour. cant get rid of the TLE on F tho ~

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    well, i don't really know about others, but the problem D cooked me hard

    at the start i made a small typo, which i found after half an hour

»
15 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I learned the hard way that Python sucks at recursion. I got runtime error doing DFS in E. Had to do it iteratively.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

https://codeforces.me/contest/2114/problem/E I want to ask in 2114E - Кирей атакует поместье how will we proceed if they ask us about any alternating path starting from that vertices like the path is not necessary to be retracted to parents everytime

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hey I am new to contests in general, will I receive rating? I solved 1 question in this round. Is this Div 3 unrated?

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    yes you will get rating if you participated rating, in div 3 after the hacking phase is over in which people challenge each other's solutions, a system testing will be there after which you will get you rating.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

can someone hint simulation proof of problem B
thanks in advance

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    Since we need to have k good pairs, we need to have (n/2 - k) 0's and 1's. Remove those and check if the remaining 0's and 1's are even or not.

»
15 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

The questions were very interesting and I enjoyed the competition. My favorite question was D.

»
15 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Guys first my program of question D was accepted and now in system testing it is showing TLE it is not fair

  • »
    »
    15 months ago, hide # ^ |
    Rev. 3  
    Vote: I like it +6 Vote: I do not like it

    Haven't you read the announcement?? It clearly said that:

    After open hacks all accepted solutions will be rejudged on successful hacks.

    So you got TLE by someone's successful hacking test (I swear it wasn't me, I only hack ppl on A and C)

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      oh so my code is hacked :(

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Not necessarily, think of it this way:

        When a person A successfully hacks person B with test C, that person A cannot hack 10k people in 12 hours because it is too much, right?

        So Codeforces makes a system to rejudge the submissions using the test C that person A hacked, and your code got TLE by that test

        • »
          »
          »
          »
          »
          15 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          just it won't give negative of -100

          • »
            »
            »
            »
            »
            »
            15 months ago, hide # ^ |
             
            Vote: I like it 0 Vote: I do not like it

            I don't think you understand how hacking works in div 3/4 rounds.

            In div 3/4 rounds, when you are hacked, your problem count and penalty just decreases, not your score.

            In fact, there isn't even a score in div 3/4 rounds, rankings are made by penalty and problem count

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I solved 3 questions but now it shows I've solved only 1. Also my rating hasn't changed. Someone please help me understand what happened. Could it have been hacked? If yes then where do I check it? Thank You! :)

  • »
    »
    15 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    It is still in the system testing phase.

    The testing system grades your submissions in chronological order, which means the later you submit, the later you will get your results. So when you have solved 3 problems and it only shows 1, it means that the system is still grading your submissions on your other 2 problems

    After a few hours after system testing, your rating will change

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hi everyone, I participated in Codeforces Round 1027 (Div. 3) with username VSS303311_Ashalina. I solved 4 problems, and the contest was rated for me. My previous rating was 556, but I didn’t receive any rating update after the contest. Could you please check if there was any issue? plz reply me_

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

In problem F , is not the best option to try to divide a number by it greatest divisor that is less or equal than k , i tried it but it didnt work .

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What is up with the judge? My 321615531 is in queue for last 10 minutes.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hi Guys, I am solving problem F in yesterdays contest. Here is my approach for x, y k:

  1. 1. do prime factorization for x, y

  2. if (x*(mul)/(div)) = y, the from above step, we can get prime factorization of mul,div. i.e. x = 20, y = 15, then x's prime factorization: = [2,2,5], y's prime factorization: = [3,5], mul: =[3], div: = [2,2]

  3. now reduce the size of mul and div. i.e. if any elements product is less than k, then remove them by replacing them with their product. make sure size of arr is as small as possible.

  4. final ans is sum of size of mul and div.

I am getting TLE with step 3. I used subsets dp approach as in https://cses.fi/problemset/task/1653 Could you please help me with this. my submission: https://codeforces.me/contest/2114/submission/321619523

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I think you are using a greedy approach, which doesn't work. You can try for example with the last but one test case, if you take any elements to replace them with their product, you can end having more steps than the solution. I don't know why you are getting TLE, it should be WA.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Let's go for worst case, say no. is 10^6 approximated to 2^20, giving factors up to 20 and it would cost us a O(x*2^x) = 20 * 2^20 which is fine, but we do dp mask twice and also we have 10000 test cases, implying our T.C shoots over 1e9. This would fail. Even I did same and got TLE coz I didn't calculated this earlier and recalled that factors till 20 should be k, but that was for just 1 testcase.

    • »
      »
      »
      15 months ago, hide # ^ |
      Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      i believe if you instead do this DP with the optimization of not counting duplicate combinations (as prime factorizations are high in multiplicity), you get a much better bound...

      instead of up to 19 (some duplicated) factors,

      you have up to 9 distinct factors (prod(range(2,11)) > 1e6), (each with an associated count, where the total counts still does not exceed 19).
      This greatly reduces the worst case from $$$2^{19} \simeq 5 \times 10^5$$$ to (i think) $$$240$$$ in the case of 720720: $$$720720 = 2^4 \times 3^2 \times 5^1 \times 7^1 \times 11^1 \times 13^1$$$

      note that $$$(4+1)(2+1)(1+1)(1+1)(1+1)(1+1) = 5 \times 3 \times 2 \times 2 \times 2 \times 2 = 240$$$ distinct subsets, where in general the number of distinct subsets of a multiset is prod(cnt + 1 for cnt in set.counts())

      edit: i realize we're actually just counting the number of divisors here

      • »
        »
        »
        »
        15 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        I am confused after reading your comment, can you summarize your comment, that would be helpful.

        • »
          »
          »
          »
          »
          15 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          basically, the DP solution can be optimized by NOT iterating over subsets that have different bitmasks but are otherwise identical (which happens when the set contains duplicates, like the prime factorization of a number)

          you could see 321709533

»
15 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

how much more time before editorial comes in?

»
15 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Can Someone please tell how to optimize my E 321650903

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I think this alone has complexity $$$O(N^2)$$$, by creating a vector of size n — n times:

    for(int i=1;i<n;i++)
        vector<int> vis(n,0);
    

    I didn't quite understand what function recurse do but it seems it has linear complexity, let alone the map which adds another $$$log$$$ factor. Regardless, think of another approach with better complexity and doesn't do dfs-similar for each node.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

One of the best G I have seen in a div3.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

the fate reference on E lol

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

My first time solving 6 problems in Div. 3

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I love this contest:)

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I just used topological sorting and then traversing each vertex in that order , it was basically just using the all known graph algorithms.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

@Vladosiya @myav @Gornak40 @KwisatzCoderach

I received a Mail today from Codeforces stating that my Solution to D (Submission ID : 321481547) in Codeforces Round 1027 matched with quite a many other users. Note here, that the question D was an easy question having a simple straight-forward approach and having the similar logic for D is not at all difficult.

The match that has occurred, I believe, is purely co-incidental because I have not used any public IDE, neither have I resorted to cheating from Pirated Sources. Also note that, I have not shared my code to anybody. I have appeared for the contest and solved the questions in legal manners.

I request you earnestly to kindly look into the matter.

»
15 months ago, hide # |
 
Vote: I like it -12 Vote: I do not like it

Dear Codeforces Team,

I received a warning that my solution 321490662 for Problem 2114E significantly coincides with another participant’s code. I want to clarify that I did not intentionally share or copy code.

It’s possible that my code was unintentionally leaked — I may have discussed logic with someone casually without realizing our final implementations would end up this similar.

I understand that even unintentional sharing is considered a violation. I sincerely apologize and assure you that I will be more cautious in the future to avoid such issues. I respectfully request that my situation be reviewed, and I am willing to accept a penalty if required.

Thank you for maintaining the integrity of the platform.

  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it -12 Vote: I do not like it

    This is a standard DFS + DP on trees template that I’ve learned through previous practice, tutorial blogs (like cp-algorithms), and contests. The transformation formulas (max(a[v], a[v] — smin[parent])) follow logically from trying to maximize gain by optionally subtracting parent paths. I wrote the code myself during the contest based on my understanding. Someone else might have use the same source as well

»
15 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I want to clarify that I did not copy any code from another participant. I wrote my solution independently before my friend. I can provide evidence, such as timestamps or version history, to confirm that my version was created first. I fully understand and respect the competition rules and would never engage in dishonest practices. Any similarities between our submissions are due to the fact that we use the same template. I would request the admin to include my rating for this contest

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hi Codeforces Team, I recently got a message saying my submission (321467772) for problem 2114F was flagged for being similar to someone else’s. I just wanted to clarify that I only use this account (The_Sambhav) and I wrote the solution completely on my own during the contest. The method I used was building a graph of divisors and doing BFS to reach the target number which is something I learned from common tutorials. The idea of checking if all prime factors are within a certain range also came from standard number theory problems. I didn’t share my code with anyone or work with anyone else, but I now realize that since this approach is quite standard, maybe someone else used the same method, which led to the similarity. Just for reference, here are some of the resources I studied these techniques from: GeeksforGeeks – BFS in Graphs, GeeksforGeeks – Finding All Divisors, CP-Algorithms – BFS, CP-Algorithms – Primality Tests, Errichto’s YouTube Playlist I respect the rules of the platform. I’ll be more careful going forward to make sure there’s no accidental overlap like this again. I hope you can review the case again and consider not penalizing my account. Thanks a lot for your time and for running such a great platform.

-The_Sambhav

»
15 months ago, hide # |
Rev. 6  
Vote: I like it 0 Vote: I do not like it

hii

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Dear Codeforces team,

I recently received a plagiarism notice concerning my submission for Problem 2114D in the recent Div. 3 contest (Submission ID: 321441614). The notice indicates a significant similarity with another user's submission (User: nortox_2144, Submission ID: 321486683).

I would like to clarify that I participated in unrated mode and submitted only this one problem before leaving due to personal commitments. The other user's submission was made over an hour later, and it appears all their submissions have been skipped.

I suspect the similarity may be due to using a public online compiler, as I'm currently facing issues updating my local C++ compiler beyond version C++11.

I assure you that I did not engage in any dishonest activity and take the Codeforces rules seriously. I kindly request a review of this issue or guidance on how to proceed.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

While I cant bring any evidence that this was just a coincidence.

I can see how both submissions are very similar to mine 321494024 , 321453033

so kinda interesting I guess.

it is a good opportunity to start recording me doing contests again.

»
15 months ago, hide # |
Rev. 4  
Vote: I like it 0 Vote: I do not like it

Hello Codeforces Team,

I have received a message regarding a similarity between my solution to Question F of this contest and that of another participant. I would like to clarify that I have neither cheated nor shared my code with anyone. I solved the problem entirely on my own and it is just a coincidence.

However, I would like to point out that a similar question — involving interchanging numbers through division and multiplication — was previously asked in a contest hosted by the Coding Club of my college. Link to the contest's questions. It was Question 1 in that contest, and its solution had been discussed at the time. Therefore, it is possible that my solution resembles others due to that prior exposure.

That said, I cannot view the other participant's submission and hence cannot comment on it. But I am confident that I have not engaged in any form of malpractice or cheating, which I understand is strictly against the contest regulations.

Moreover, the structure of my solution to this problem is consistent with my other submissions, which can be verified. I respectfully request the admin to review this conclusive explanation and the provided evidence and kindly remove the allegation from my account.

Thank you.

»
15 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Hi Codeforces Team,

I received a message concerning plagiarism for problem 2114D of this contest on my submission 321509477 with user P1KACHUUU for their submission 321458826.

I completely understand that plagiarism and colluding is against the codeforces guidelines; however, I believe the similarity between our code is completely by coincidence. I developed my solution approach by considering that it would be optimal to remove the point that is at the smallest or largest x-y positions. I then considered the cases where the smallest / largest x and y are the same point and adjusted for that. Finally, I considered the case where the remaining area is equal to n — 1, in which case we must add the removed point back to the shortest side.

Although our code is very similar, I think it is reasonable for two random contestants to have the same intuition regarding this problem and implement our solutions in the same manner. Looking at other solutions for 2114D, if participants only consider using arrays rather than multi-sets or other ordered data structures to find the remaining max and min, their solutions would be very similar to mine and P1KACHUUU's. Secondly, our code differs in the fact that to create a list of points sorted by the y values, P1KACHUUU uses a list with points stored as {y, x} along with the list of points stored as {x, y}. On the other hand, my solution creates two lists, but stores both as {x, y} points and simply uses a custom comparator to sort the second list into non-descending order by y-value. This slight difference causes distinct problems for sharing code as it requires the re-ordering of every line involving the second list of points sorted by y-values.

I also think that considering P1KACHUUU is over 1600 rated and was thus not able to compete as a rated participant in a Div 3, it is highly unlikely that they decided to collude and submit plagiarized code. I did not plagiarize, and I believe that neither did P1KACHUUU. Although I can only claim that our code is similar due to random coincidence, I do not believe that this similarity is completely improbable.

Please look into this, and thank you for your time.

-Andelupe

»
15 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Hello Gornak40, KwisatzCoderach, Vladosiya, myav, and Codeforces team,

I received a notification that my solution 321514179 for problem 2114D coincides with others. I want to clarify that my solution uses a common and standard approach with prefix and suffix arrays to compute min/max values, which is widely known in competitive programming.

Though the approach is common, I implemented it using a custom struct point that others didn’t use, and my variable names and function structure are different.

My solution was developed independently, based on these well-documented methods (e.g., Codeforces blog: https://codeforces.me/blog/entry/133828, GeeksforGeeks article: https://www.geeksforgeeks.org/prefix-sum-array-implementation-applications-competitive-programming/).

Thank you for your understanding. I’m happy to provide further details if needed. "I only used CodeChef's online IDE to write my code, and I never shared the link or the code with anyone. I believe this must have been an unintentional coincidence or an unauthorized copy."

– ashok4

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hello, I recently received a notification stating that my solution (ID: 321479165) for problem 2114D coincides significantly with another user’s solution (Slumio/321472983). I would like to clarify that I do not know this user and did not share my code with anyone. This was purely a coincidence. The only similarity between our solutions is the use of prefix and suffix arrays, which is a common idea in competitive programming. The idea is also available prior to the contest on the website: https://www.geeksforgeeks.org/precomputation-techniques-for-competitive-programming/. I implemented my solution independently using these well-established strategies. I kindly request the moderators and the head of Codeforces, Mike Mirzayanov, to carefully consider this explanation and remove the allegations against me. Thank you very much for your understanding and support.

– charanteja001

»
15 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Subject: Clarification Regarding Submission Coincidence in Problem 2114D (Submission ID: 321472983)

Dear Codeforces Team,

I would like to firmly state that I have not engaged in any form of cheating or rule violation during the contest in which I submitted solution 321472983 for Problem 2114D.

I do not know the users charanteja001, and I have never communicated or shared any code with them. My submission was made before the other mentioned users, which is clearly visible in the submission timestamps. I fully understand and respect the rules of Codeforces and competitive programming ethics, and I take them very seriously. I am ready to provide any additional clarification or information that might help in resolving this issue fairly.

»
15 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hi All, I recently received a message that my code significantly matches with another person whom I don't even know (https://codeforces.me/contest/2114/submission/321530468).

I would like to clarify that my submission was made much earlier than the concerned person and I have not shared my code to anyone and have written the code in my own VS Code. My code involves a basic BFS traversal using queue using visited array. I dont know how I got flagged even though I have not copied from anyone or anywhere. I would request to reconsider my code and my contest submissions are not skipped.

Thanks!