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

Автор shiven, 12 дней назад, По-английски

Hello Codeforces!

We're glad to invite everyone to participate in Codeforces Round #1091 and CodeCraft '26 (Div. 2) — IIIT Programming Club's eighth round on CF! The contest will start on Apr/07/2026 17:35 (Moscow time) and will be rated for all participants with a rating below 2100.

Codecraft

There are 8 problems to solve in 2 hour and 15 minutes, with two of these being easy and hard versions. You'd want to read all the problems :)

This round has been over a year in the making, and a lot of people helped us put it together. Thank you to:

Hope you enjoy the contest!

Score distribution: $$$500 - 1000 - 1500 - 1500 - 2000 - 2750 - 3250 - 3750$$$

UPD: The editorial has been published.

UPD: Congratulations to the winners!

Top 5

Among Rated Participants

We hope you had fun! Here's the team after 2h of watching submissions roll in. Yes, the shirts still say '23. Priorities.

Codecraft

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

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

As a tester, I didn't come up with a good tester comment in time for this announcement :(

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

As a tester, when am I getting my IIIT-H Programming Club hoodie?

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

I love penguinnoob. __

I Wish he converts to DD and stays in IIITH for 1 more year :)

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

CodeCraft '26

Did you mean CodeCraft '24?

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

as a tester

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

You haven't mentioned what will happen to cheaters, Will they go to cry's basement or what?

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

I want to question the statement of Problem F in Round 1090. It seems very unfriendly to Chinese contestants who use translation plugins, and it has caused some of their submissions to be skipped.

Anyway, good luck and have fun!

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

hoping to become a specialist this round

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

yyyeeeyyy, another opportunity to lose some rating

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

shiven orzzz!

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

Hopefully I cross the newbie barrier

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

My last chance to reach master before my birthday :(

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

    when is your birthday?

    • »
      »
      »
      12 дней назад, скрыть # ^ |
       
      Проголосовать: нравится +32 Проголосовать: не нравится

      14th April,guys

      • »
        »
        »
        »
        12 дней назад, скрыть # ^ |
         
        Проголосовать: нравится +4 Проголосовать: не нравится

        ooo thats close, mines 12th thats why i asked lol

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

          mines at 22nd :)

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

            mines 28th lol

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

              mine today!

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

              mines on 11th, today

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

                happy birthday!

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

        Mine is on 14th April as well!, I wanted to reach expert before mine, which I did:)

        Hopefully you reach your goal too!

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

I am the #1 kevaljain fan

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

Wait. That means total of 10 problems for this contest (8 problems, 2 of them have 2 subtasks)? And we only have 2 hours and 15 minutes?

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

As an Egyptian I love pyramids!

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

As a tester, I tested cry's basement.

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

As an author, SmolBrain you better AK the contest ^_^

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

Vary unusual start time

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

Probably my last contest as a undergraduate student -_-

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

As a contestant, good luck to everybody!

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

As not a tester, I don't want to go to anyone's basement.

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

Hi everyone, Im new to Codeforces and also new to C++, so I’m not really sure where to check the difficulty of this contest.. sooo is it suitable for beginners?

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

Too much authors.

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

AuthorForces

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

Why is akslolcoding testing literally every contest like are there any contest that my guy is actually participating in

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

guys it is my first time in codeforses i'am only here for schol but i'am glad to be part of this community

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

where is the score distribution??

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

IIIT HYD is conducting context. In which div level it

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

Test is coming soon.But score contribution is still a mystery......

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

Hey, just wondering does anyone thing like someone like myself with a rating of 1313 do this contest ???

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

Please dont share score distribution after the contest :D

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

C and F subtask??

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

how to be a tester?

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

Was the top of leaderboard banned? Stormed through the problems and vanished, LMAO

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

$$$C$$$ and $$$D$$$ are so bad problems. Just guess, don't bother trying to come up with observations.

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

    Is there any proof of gcd in c? Or is it just observation

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

      YES that's a REALLY well known concept in mathematics, I can't comprehend why is everyone hating that question

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

        can you please tell me the topics or any resources to study to be able to know that proof

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

          Sorry I wasn't able to find any sources but here let me demonstrate myself:

          take a frog that jumps from a lily pad to another on a circle of N lily pads, jumping S steps to the right each time. As there aren't infinite lily pads one can see that it is required for the frog the step on a lily pad twice. Lets say that the first time the frog steps on a lily pad L for the second time, there was k steps between the first and second time it stepped there. Since we know that the frog took k steps to come back to where it started we might now conclude that the frog come backs to its current location every k steps as the lily pads are symmetrical, that is to say there are no difference between them, so coming back to one lily pad after k steps means k steps always makes the frog go back to initial position. and since a lily pad can't be visited twice before taking k steps we know that the frog has visited k different lily pads on total, and will ever visit them, as a loop started. So the question is: what is k equal to? There we have kS=0 (mod N) all leafs visited should mean that we have no kS=0 until k=N thus there should be no k such that k!=N and kS=0 mod N, if S and N had a common divisor d, we would have (N/d)S=0 mod N as S=ad for a random int a and (N/d)S=Na which does equal to 0 mod N. This question also requires showing that on the case that the only common divisor being 2, there are exactly two possible routes for the frog to go but using what I have already told, it should be easy to prove that yourself. (turns out the frog example was made up by our teacher so searching Frog Theorem as our hs teacher called it showed no results)

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

I created video editorial for D. Flip the Bit (Hard Version)

I also created video editorial for E. Definitely Larger

Problem F has 2 independent parts, one is Game Theory, and the second is Bit Manipulation / DP. I made a video editorial for the first part.

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

SHIT ROUND

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

guessforces

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

Why these problems reminded me of JEE

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

HUH?

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

For $$$C$$$, I just guessed if gcd(n, m) > 2 then no solution. And I assume $$$D$$$ has to do something with blocks of 0's and 1's.

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

C should have been easier, i think and i don't know how there are more than 6k people who solved that, most of them must be cheaters

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

    Yes, rankings and ratings have no value now, and no CP authority seems to care enough to act*, so I guess competitive programming might just die slowly...

    *I don't count a cheaters database as acting, that is pretty useless. The incentive to cheat needs to be destroyed entirely (e.g. by not making rankings and ratings public).

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

    Well for me C was even easier than B honestly, the coprime finding algorithm is well known and after applying it to see if each row and column would get visited, applying it once again to see if each visits would coincide was also a really basic idea as well.

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

D is much much harder than E. Still can't understand why there are so many ACs in D

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

Feeling dumb after seeing submission count on C

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

F is a beautiful problem, but this round had some issues, for instance D is WAY harder than E and for C you just gotta guess and assume correct, i didn't get to solve G and H so i won't comment on those

»
11 дней назад, скрыть # |
 
Проголосовать: нравится -31 Проголосовать: не нравится

I really enjoyed C, thank you.

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

    can you prove it?

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

      It would be too tedious to write out a full proof, but here's a sketch for why $$$\gcd(n,m) =2$$$ works, but $$$\gcd(n,m) \gt 2$$$ doesn't work. (The rest of the problem is trivial).

      If $$$\gcd(n , a) = 1$$$ and $$$\gcd(m , b) = 1$$$ you can just pretend $$$a = 1, b = 1$$$.

      Maximum order of an element in $$$\mathbb{Z}_n \oplus \mathbb{Z}_m$$$ is $$$nm/\gcd(n,m)$$$. $$$(1,1)$$$ achieves this maximum.

      If $$$\gcd(n,m) \gt 1$$$, $$$(1,0) \notin \langle (1,1) \rangle$$$.

      The visited cells choosing to go right first are in $$$\langle (1,1) \rangle$$$ and $$$(1,0) + \langle (1,1) \rangle$$$. Both of these sets are of cardinality $$$nm/\gcd(n,m)$$$ (and distinct if $$$\gcd(n,m) \gt 1$$$), so the total number of visited cells is $$$2nm/\gcd(n,m)$$$. If all $$$nm$$$ cells are visited, then $$$\gcd(n,m) = 2$$$.

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

        if you're at $$$(0, 0)$$$ assume $$$0$$$ based indexing, lets discuss the necessary conditions.. all row indices must be visited independently -> $$$gcd(n, a) = 1$$$ similarly $$$gcd(m, b) = 1$$$ Now, no. of moves till it takes a circle and comes back to origin is $$$2 * lcm(n, m)$$$ And we should visit all atleast once..

        $$$2 * lcm(n, m) \gt = n * m$$$
        $$$= \gt gcd(n, m) \lt = 2 $$$

        These are the necessary and sufficient conditions

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

          Can you give some mathematical proof for the number of moves till it takes a circle and comes back to (0,0) being 2 * lcm(n, m) ?

          I'm unable to understand this part.

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

            We have n*m positions, and since all positions are symmetrical we can say that if it takes S steps to come back to a square after moving from it, than we have coming back to any square from it also takes S steps. Thus in those S steps we know that we have also visited S different positions. Lets define a step as moving left and down 1 step (as we can pretend a=b=1 now). Here at Sth step we are on (S mod n, S mod m). For it to make 0,0 we should have n|S and m|S, thus the first time we get back to 0,0 namely the amount of positions we visit becomes lcm(n,m) BUT we defined steps as moving left and down (or down and left) if we seperate those steps we see that we visit double the number of positions, thus comes 2*lcm(n,m)

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

Anyone How to Approach D ?

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

For C I observed that you can reach all values from 1 to n with a jumps only if gcd(n, a) == 1 and similarly for columns gcd(m, b) == 1. I thought that if you can reach all values separately than you can reach them together somehow after many jumps but I was wrong in the assumption. Anybody solved this, can you tell me what was the other necessary conditon?

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

Whoever wrote D, I'll hunt you down (then I'll do nothing but tell you why)

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

Can anyone explain to me how to do C I'm so confused after spending an hour on it. I was just drawing random things and telling myself I can't simulate it because it's 10**9 and just trying to find something mathematical to use

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

How to simply prove the conclusion of Problem C?

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

    assume correct ♥️

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

    proof by accepted

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

    First, it is apparent that $$$(n, a)=1$$$ and $$$(m, b)=1$$$ must hold.

    Then, if $$$n$$$ and $$$a$$$ are coprime, and $$$P={1,2,...,n}$$$ is a permutation of $$$n$$$, then $$$aP={a, 2a, ..., na}\pmod n$$$ is also a permutation of $$$n$$$.

    So we can arrange the index(row and column) $$$[1,2,3,4,...]\to[1,1+a,1+2a,...]\pmod n$$$. In the new grid, the two moves transform into:

    • Jump 1 step right

    • Jump 1 step down

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

    Firstly, to visit all the rows, we need to visit the row after the current row we are standing on after a cycle is completed starting from the current row. That implies, gcd(n, a) = 1. Similarly, gcd(m, b) = 1 is the condition for visiting all the columns. Now, after a cycle (moves after which we return back to (1, 1)), all the cells must be visited. Otherwise, we can never visit all the cells. Let's count the number of moves required to complete a cycle.

    Number of moves to complete a cycle = 2 * lcm (n / gcd(n, a), m / gcd(m, b)) = 2 * lcm(m, n). Let's understand why 2 is multiplied here. We need lcm(n, m) moves to complete any one of the rounding (either row wise or column wise. It actually depends on the first move we choose). But, we have to round both row and column to get back to (1, 1). So, we need 2 * lcm(m, n) moves in total. Also, in a cycle, each move covers a unique cell. So, the number of cells covered in a cycle = 2 * lcm(m, n).

    To fulfill the condition, 2 * lcm(m, n) >= m * n -> gcd(m, n) <= 2.

    So, the answer will be "YES" iff gcd(a, n) = 1 and gcd(b, m) = 1 and gcd(m, n) <= 2.

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

    If gcd == 1, when you finish a full loop, you'll eventually arrive back at tile (1,1) but moving in a different direction (if your first move was right, you'll come back and move down, and vice versa) This triggers a second phase that fills in all the gaps

    If gcd == 2, when you finish a full wrap, your path shifts perfectly landing you right next door on a tile like (1,2) or (2,1)

    If gcd == 3 (or higher), the gap is too wide, the loop closes too early, and some tiles will never be reached

    This is what I understood

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

I used two pointers for B was that the easiest way?

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

Feeling frustrated as a person who loves writing big codes, on B I got in on 6th try with 117 lines of code :(

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

Thanks for all the effort you put into creating this contest. Not a single problem in this set is boring, even though i did not manage to perform well in this contest. Better luck for me next time.

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

C broke my dream of coming back to expert rank

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

Just rename the platform to MathForces atp.

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

hardest problem C i've ever seen

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

Can we get the fastest solves for each problem , lol , by friend got it for D (he is shy) :)

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

Timmy1003 is a cheater, look at his H solution and other solutions. the amount of code and the style is different to A — D solution.

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

I was trying something like this in problem C There exists a number k[i][j] such that k[i][j] = i mod n k[i][j] = j mod m For all (i,j) in [0;n-1] cross [0;m-1] Can anyone extend this approach? Possibly simplify something using CRT?

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

In problem C, gcd(n , a) == 1 and gcd(m , b) == 1 these are obv necessary conditions. But how to prove gcd(n , m) <= 2?

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

    Your state will repeat itself after $$$\frac{2mn}{gcd(m,n)}$$$ jumps, thats why $$$gcd(m,n)$$$ must be not exceeding $$$2$$$.

  • »
    »
    11 дней назад, скрыть # ^ |
     
    Проголосовать: нравится +26 Проголосовать: не нравится

    To visit every tile, the sum of two sets of landings (even steps and odd steps) must be at least the total size of room, easy to get

    $$$ \frac{n*m}{\gcd(n, m)} + \frac{n*m}{\gcd(n, m)} \gt = n*m $$$

    =>

    $$$ \frac{2}{\gcd(n, m)} \gt = 1$$$

    =>

    $$$ gcd(n, m) \lt = 2$$$
    • »
      »
      »
      10 дней назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      still can't get it. suppose S[r] denotes the set of positions that even steps visit, and S[l] denotes the set of positions that odd steps visit. Shouldn't the condition be |S[r] ∪ S[l]| >= n * m ?

      gcd(n, m) <= 2 only guarantees |S[r]| + |S[l]| >= n * m.

  • »
    »
    11 дней назад, скрыть # ^ |
     
    Проголосовать: нравится +5 Проголосовать: не нравится

    I imagined reordering the rows and columns so that every operation looks like one step right or one step down.

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

    You can use Bezout to prove it. You can work with 0 indexed because it is easier.

    Suppose you choose to add b k1 times(so now i is congruent to b*k1 mod n), now in order to have the same residue of i mod n, we should set k1 to k1+ k*n. Same thing applies for columns. Then we can just choose k1, k2 the number of times to add b to i and j respectively such that abs(k1-k2) = 2, then the condition of the problem obliges us to make abs(k1-k2)=0 or 1, in order to do that we should find x and y such that x*n + y*m = 1 or 2, which means that the gcd of n and m is <= 2

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

I think D>E, F, G.

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

how to prove in $$$C$$$ that $$$gcd(n,m)$$$ $$$\le$$$ $$$2$$$

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

    I am assuming you already understand why gcd(n,a) and gcd(m,b) are 1. Assuming these two are true, you can observe the following:

    • if the gcd of (n,a) is 1, then LCM(n,a) is n*a. this means that after travelling n*a squares the person will be at their initial position. each jump has height a, so n*a jumps takes n jumps and thus the vertical position of the person oscillates with time period n.

    • a similar line of reasoning can be used to deduce that the time period for the oscillation in the horizontal direction is m.

    assume for example it takes 8 jumps to get back to the origin vertically and 7 jumps horizontally. this means that we end up at the exact same initial position after 56 turns (with both jumps). thus, the most amount of unique squares we can visit is bounded by lcm(n,m). since each turn has one horizontal and one vertical jump, we can visit at most 2 * lcm(n,m) unique squares before returning to the origin.

    to cover the whole grid, the maximum amount of visitable unique squares must be equal to or greater than the number of squares in the grid. Thus 2*lcm(n,m) >= n*m. With a bit of algebra, this is identical to gcd(n,m) <= 2. (I used the lcm version of the condition in my solution anyway)

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

Dont ever write a contest ever again

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

@Musa_82FaGm used AI for sure, look at the problem H, and other solutions, he used

if(!(cin >> xxx >> ) return; some solution cin >> xxx; directly. only GPT/Gemini would do defense IO in codeforces, and you can see the almost the main and coding style is different for each solutions. the top standing almost all ai. this is AIforces. mf

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

Problem C is beautiful.. Was a bit upset initially that it is some random guessing, but the solution is very elegant and is something that can be come up with.. Great!

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

IN PROBLEM B , 3 1 0 1 0 2 why the answer is 2 , when i can do [0,0,0] just in one operation?? can anyone explain please .

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

can anyone give me the valid mathematical cum logical proof for c gcd(n,m)<=2 i guessed it into the contest but searching for proof and not finding any , it will be really helpful

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

    For every x,y there is cycle with some length. Cycle length is also number of visited cells.

    When gcd(a,n)=gcd(b,m)=1, let:

    ka=0 mod n
    kb=0 mod m
    k>0
    

    Let l be min_k. If l%2 is 0, real length is lcm(n,m). If l%2 is 1, then if you started with horisontal step, now step will be vertical. Real length is 2lcm(n,m).

  • »
    »
    10 дней назад, скрыть # ^ |
     
    Проголосовать: нравится +6 Проголосовать: не нравится

    Assume $$$\gcd(a, n) = 1$$$ and $$$\gcd(b, m) = 1$$$, otherwise the answer is NO

    Suppose the steps were done simultaneously, then you add $$$(a, b)$$$ to your current coordinates. Can you reach the cell $$$(a, 0)$$$ (which would normally be achieved because of the alternations)? The coordinates have the form $$$(at, bt)$$$, so to reach $$$(a, 0)$$$ we must have $$$a \equiv_n at$$$ and $$$0 \equiv_m bt$$$, which means that $$$t \equiv_n 1$$$ and $$$m | t$$$, which is possible iff $$$\gcd(n, m) = 1$$$. Okay, but what about the case when $$$(a, 0)$$$ isn't reachable. Then $$$(2a, 0)$$$ must be reachable from $$$(0, 0)$$$ by moving in the direction $$$(a, b)$$$, since it cannot be achieved from $$$(a, 0)$$$ the same way. Again, we get that $$$t \equiv_n 2$$$ and $$$m | t$$$, which requires $$$\gcd(n, m) | 2$$$. And if you can reach those cells, it's not hard to show that all other cells are reachable as well

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

I couldn’t think of a worse round, thanks.

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

Why hasn't the rating been calculated yet? Is the contest still rated?

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

wow there are so many algorithm geniuses in a div.2 round where so many grandmasters (even lgm) are beaten by so-called [trusted participants] :)

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

I hate C

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

Why isn't it rated for me? It says not rated in the rating chart but here they say it's rated. Im really confused.

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

Nice Contest!! btw how to become a tester in a contest?

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

Could you guys update rating before the heat death of the universe plz :3?

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

just to complain, i think problem authors and testers should really check the ambiguous or confusing expressions in your descriptions. last night i stuck at problem a for approximately half an hour and eventually gave it up. I mistakenly thought one could decrease multiple positions, because the "some" word in the description. i didnt realize it until just now i went through it again and found there was a "it". changing "some" to "a" would be much clearer for foreigners. i also recommend authors fix description in problem g. it is not said in the description that left and right son are taken differently, and the "labeled binary trees" would easily mislead the participants to count labeled trees(nodes labeled from 1 to n). these details should be clarified in descriptions rather than letting participants to find out by checking the examples. it would be my pleasure if you could accept these suggestions.

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

The first few questions of this competition were almost testing the luck of whether one could find the patterns. I think this competition is really terrible.

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

Is this round unrated?

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

Why hasn’t it been scored yet after 12 hours?

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

why ratings are not given yet?

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

Me and my homies waiting for the ratings:

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

Please calculate the rating!

I have wait it for 14hours.

Edit: Rating Updated, I got 2098 ?????!!

WTF ?!

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

Calculate the rating when! T_T

Hope not unrated.

Edit: +369 rating hooray! ^_^

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

Is the contest still rated because it is taking quite long now for a div 2 contest ratings to be updated?

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

test

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

I'm frustrated too with the delay in rating change announcement, but can you guys just stop bombing downvotes while waiting for rating results? Organizers really put a lot of effort into making this round.

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

Cool, finally rated.

But why did it take that long?

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

[deleted]

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

[deleted]

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

Easily the worst contest I participated in so far. That was so disappointing.

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

Hello,

I received a notification regarding similarity between submissions for problem 2217B.

I want to clarify that both accounts mentioned are owned and used by me. The similarity occurred because I used the same approach on my own accounts.

I was not aware that participating with multiple accounts in the same contest violates Codeforces rules.

I understand this now and sincerely apologize for my mistake. I assure you that I will use only one account in future contests.

Thank you.

»
10 дней назад, скрыть # |
 
Проголосовать: нравится -32 Проголосовать: не нравится

Hello,

I recently received plagiarism warnings for problems 2217D and 2217F in this contest, and I was quite surprised and concerned about it.

I would like to sincerely clarify that I solved both problems completely on my own during the contest. I did not access or refer to any other participant’s code. I spent time thinking through the approach myself, mainly using XOR transformations and bitwise reasoning, which I understand can sometimes lead to similar implementations among participants.

It is a bit disheartening to see my submissions flagged, as I always try to follow the rules and compete fairly.

I understand that structural similarities can happen in such cases, and I respect the system in place. I kindly request you to review my submissions once again. I would be happy to explain my approach in more detail if needed.

Thank you for your time and consideration.

»
10 дней назад, скрыть # |
Rev. 5  
Проголосовать: нравится -29 Проголосовать: не нравится

Deleted

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

Dear Codeforces,

I received a similarity flag on my submission 370158810 for problem 2217D, and I would like to clarify my situation.

I worked on this problem independently during the contest. Initially, I implemented a more direct approach by explicitly counting segments where elements differ from x.

My earlier submission: 370139065, 370145835

After that, I refined the same idea into a more concise implementation by transforming the array into a binary form and using a difference array (XOR) to track transitions between segments.

My later submission: 370158810

Both approaches are based on counting segments where a[i] != x, but implemented differently (explicit counting vs. transition tracking). I believe the similarity comes from using this common technique.

I did not copy any code from other participants. My submission history reflects my step-by-step development of the solution.

I respect the Codeforces rules and would never intentionally violate them.

Regarding the system warning, I want to clarify that I compiled and tested my code entirely locally. I did not use ideone.com or any public online compilers during the contest.

Thank you for your time and for maintaining a fair environment.

Sincerely, Sogni265

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

Respectful Appeal: False Positive Plagiarism Flags on 2217B and 2217D (pulkitjaincs)

Hello Codeforces Team and Round Coordinators,

I am writing to respectfully request a manual review of the coincidence flags placed on my account (pulkitjaincs) for my submissions on Problem 2217B (370128856) and Problem 2217D (370152721).

I fully support the automated systems used to keep Codeforces fair, but I coded these solutions entirely independently in my local VS Code environment. Because both problems have straightforward optimal paths, the underlying logic aligns with other users. However, a manual look at the raw code reveals undeniable proof of independent creation:

Evidence for 2217D (Dynamic vs. Static Array Construction):

My Approach: I dynamically constructed my padded auxiliary array using .push_back() line-by-line (pExt.push_back(0);).

Flagged Users: Both Starrism0203 and BongCoder... used a completely different conceptual approach: pre-allocating a static vector of size k + 2 and using direct index assignment (P[i+1] = p[i]).

Loop Boundaries: My inner loop explicitly defines startGap and endGap with an inclusive boundary (<= endGap), whereas the others rely on different boundary logic and prefix increment operators (++i vs my g++).

Consistent Stylistic Evidence (Across Both Problems):

Bracing/Indentation: My local VS Code auto-formatter uses strict Allman style (opening braces { on entirely new lines). The other flagged users consistently use K&R style (braces on the same line).

Macros: I reflexively included using ll = long long; but stuck to standard int types. The other users forced heavy macros like #define int long long and used signed main(), which I did not use at all.

Naming Conventions: My variables (cL, cR, maxC, pExt) are distinct to my personal coding style.

I take the rules of this platform very seriously. I kindly request that a moderator review these specific, human-typed differences, as they strongly indicate my code was written from scratch.

Thank you for your time and hard work in maintaining the integrity of the platform.

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

C problem was very frustrating. I was trying to prove my approach but couldn't do so in the contest. Had to see the editorial.

If anyone has seen some similar problems to C, i would very much appreciate sharing them with me.

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

How many of the top 5 (rated) used chatgpt? Very interesting contest history for some of those participants...

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

All the best!!

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

Finally spec yay

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

D is trash

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

i got -61 was able to solve first problem only , dammm bad at cp

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

learned a lot from the contest