Shoo's blog

By Shoo, 17 months ago, In English

Hello, Codeforces!

eren__, sweetweasel, and I are glad to invite you to Codeforces Round 1024 (Div. 1) and Codeforces Round 1024 (Div. 2). Both rounds take place at May/11/2025 17:35 (Moscow time), and have a duration of 2 hours and 30 minutes.

The Division 1 contest is made up of $$$6$$$ problems, and the Division 2 contest is also made up of $$$6$$$!

We would like to thank:

This is our first (and hopefully not the last) contest on Codeforces, so we really hope you will like the problems. Don't forget to have fun!

The score distribution of the rounds is as follow:

Division 1:

$$$500 - 1250 - 2000 - 2500 - 3250 - 3750$$$

Division 2:

$$$250 - 500 - 1000 - 1750 - 2500 - 3000$$$


In the end, here’s a behind-the-scenes photo of the authors putting in the effort to bring you a fun round!


UPD1: The contest is now over. Congratulations to the winners!

Div. 1:

  1. Radewoosh

  2. tourist

  3. maspy

  4. Ormlis

  5. rainboy

Div. 2:

  1. 2ky

  2. LuOH3_

  3. Untitled_unrevised

  4. toku4388

  5. Horrible120

UPD2: The Editorial is now out.

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

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

As a tester, I wish the authors would win the IOI.

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

One can confirm by looking at the photo, that the authors are smart and good-looking.

»
17 months ago, hide # |
Rev. 2  
Vote: I like it -18 Vote: I do not like it

As A participant I hope Enjoy.

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

A power of two round can't miss it, the next one will be 1024 rounds later

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

orz

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

as a none tester, I can confirm this contest will be epic

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

This would be my 100th rated round...Excited for this !

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

    Hey bro quick tip: between rounds work on problems that are 200–400 points above your current rating so (1800 to 2000) for 50–100 of them until you can solve them quickly. This helped me a lot during my IOI and ICPC training when I was stuck at ~1700. Hoping for a +delta for both of us

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

    Try maybe solving alot of CSES Problems too their is only 300 of em i did it all in a couple of months helps alot.

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

i hope the round is strong strong

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

Yay, my first Div1 contest. I'm so excited!

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

As a participant, I hope solve three questions and become a specialist.

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

As a failed cyan, it's inspirational to see a lot of newbie prodigies AKing the contest I am sure that future of CP is in right hands ...

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

But I don't see 720 problems in the Div 2 round...

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

Wow 1<<10th contest

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

wish to have non-negetive rating change :)

»
17 months ago, hide # |
 
Vote: I like it -21 Vote: I do not like it

I wish to hit pupil :D

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

As a potential participant, 720 problems in Div. 2 is kinda scary. Good thing it's 2:30 and not just 2 hours long.

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

Let's take out our horses for the cowboy round.

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

1024 is a very meaningful number,This contest must be very exciting !!!

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

I used to think top coders were nerds, but the image in the blog changed my mind.

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

EL Classico or this contest? Hmm...

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

My first div 1 :) !

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

Codeforces Round 1<<10!

Looking forward to a Wonderful Round :D

»
17 months ago, hide # |
 
Vote: I like it -40 Vote: I do not like it

I think this is gonna be a speedforces round for Div. 2

»
17 months ago, hide # |
 
Vote: I like it -21 Vote: I do not like it

What score actually is? Is it connected to the problem's rating?

Please don't get me wrong.

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

    The score distribution will be very helpful if you actually care about the details:

    • "Not AC verdict" for test > 1 will cost 50 points. The take away is the smaller the point of a problem is, the heavier WA penalty will be felt (because the minus is constant for every problem).
    • Should I skip problem "x" to solve problem "x+1" with higher score and higher difficulty trade off.

    But I'd suggest you to focused solve problems in order and ignore the hairy details for best practice atm. You might want to revise the details later, once you starting to getting good at it.

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

    Is it forbidden to ask anything if I don't know something? Like, why am I getting dislike just for asking a question?

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

      Probably because this question gets asked under every contest announcement, even though it's easy to understand what it is by searching it up

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

Well. I guess I'm a reverse nutella now.

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

@ of the guy in sunglasses?

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

will i be green ,who cares i am from a warrior race

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

this is the second div 2 in a row where we have 250 on problem A

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

Congurats!It's round 1024!

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

oh! the contest number 10000000000 -__-, i cant wait for it fr <3

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

CF round $$$10^{1010}$$$.

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

let us give this contest 1<<10 upvotes to celebrate nice number for the round.

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

Good luck, guys! I'm sure you've cooked a great contest.

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

I'm gonna cook inshallah

»
17 months ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

As a non tester, i was supposed to test but forgot, wish you a good contest

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

there's 720 problems in the div2???

edit: oops i just realized two people commented this before me... i'm unoriginal :(

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

Round 10000000000 is here!

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

Time to ready my a+b template because A is 250 points

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

Very nice LOL

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

Yeah,finally it's round 1024.And when will round 2048 come

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

Just out of curiosity, why some rounds have unrated option but this one doesn’t?

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

    Icpc style contests: div 3,4, Edu rounds do, Cf styles dont

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

      Thanks! I wanted to participate in this round but I am 100% confident I won’t perform my best tomorrow; so unfortunate I will miss 1ll<<10

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

Thats not the round 1024, thats round 2^10

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

That first photo straight up looks like Dagon's Domain Expansion — ocean vibes , domain expansion pose and all Gotta be Toji Fushiguro to clear it all up with zero cursed energy but max smoke

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

"The Division 1 contest is made up of 6 problems, and the Division 2 contest is also made up of 6!"

Why is the Division 2 contest made up of 720 problems??

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

from the score distribution of div.2, it seems the speed to solve first three problems would be a major differentiator, and if solved 4th it would give much edge over other participants

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

what problem rating should i expect for the first 3 of div2?

and hope to reach pupil in this contest..

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

First time participating in a 1 << x contest >:)

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

2^10 congratulations!

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

As a participant, seeing Um_nik as a tester means useful algorithms.

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

As a tester, haji ajab cantesti !!!

»
16 months ago, hide # |
 
Vote: I like it -269 Vote: I do not like it

as a tester, i know problem A

and this is the answer of problem A:

cin >> q; while(q -- ){ cin >> n >> m ; cin >> r >> c; cout << max(r — 1 , n — r) + max(c — 1 , m — c) << endl; }

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

Happy round 0b10000000000

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

will manhandle this contest

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

Again 250 score for problem A!

I hope to not get minus on that.

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

Why are the scores so strange today?

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

How long does it usually take for someone to reach candidate master on average? I've been participating in contests since the beginning of 2025, but I feel that I'm still far away :(

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

Hope to solve today's ABC as fast as possible.

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

Lets call this contest "The 10th bit"

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

Failed to start like Mbappe in todays contest...**Hala madrid**

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

aaah!! couldn't solve div2 D... got messed up in case work. is there a simple solution ?

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

    Fill the first $$$n-3$$$ places greedily

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

      yeah, did that; but how to decide the order of nth and n — 2th term?

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

        Parity of the permutation is invariant, so just compute it for the original permutation and one of these $$$2$$$ potential answers and using that, figure out which of them has the right parity.

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

          this is brilliant, thanks.

          someone else also mentioned this, I wish I could figure it out.

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

          spent 1h30 searching for an invariant, didn't find one..

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

          Ahh, I knew there had to be some invariant. I was stuck for almost 2 hours trying to "guess out" the most arbitrary property of the swap operation...

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

          Could you please explain what do you mean by parity of permutation ?

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

        exactly one ordering among the two ordering of $$$nth$$$ and $$$n-2 th$$$ element is possible so if we keep filling in first $$$n-3$$$ places by continuous naive swapping; the array that remains in the end is the answer , but issue is how to keep track of the changing array within time limit , thing is I have figured out it is safe to assume that in one operation it is possible to swap $$$a[i]$$$ and $$$a[j]$$$ ,$$$a[i+1]$$$ and $$$a[i+3]$$$ where $$$j$$$ is any $$$index \gt i$$$ with the same parity as $$$i$$$

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

        the sum of number in inversions in individual even and odd arrays % 2 before and after the rearrangement remains the same so if the sum of inversions in odd array and even array is odd then the smaller number will come at nth place else vice versa

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

      yeah I figured that I just have to handle last 3 places.. and at max one inversion will remain in odd and even places total

      but it seems in some cases you can still sort remaining positions by doing some swaps initially ( I think ).. couldn't figure out in what all cases it is possible to sort both odd and even position completely.

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

        Hmm good point but I think the last three elements are already uniquely determined (not sure)

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

          oh your pretest passed so I think you are right.. did I make a silly mistake.. nooooo!!!

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

        Total count of inversions will remain same modulo 2 (For one operation it can change by 0/-2/+2/+4/-4 etc.). If we get a different modulo 2 for the greedy complete sort approach, just swap nth and n-2th positions.

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

          Could you please provide the proof/intuition behind this ?

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

            Proof of Inversion Parity

            Consider a b c d -> c d a b

            For element 'c', inv += (c>a?1:-1) + (c>b?1:-1) = {0 or -2 or +2}

            For element 'd', inv += (d>a?1:-1) + (d>b?1:-1) = {0 or -2 or +2}

            Proof of Greedy Selection

            Position parity of every element remains the same (i.e. you can only move an element among the odd positions if it is initially at an odd place, likewise for even)

            Further greedy selection possible for 1 to (n-3)th element

            n-1th element already decided(greatest of its parity) so all that is left to to determine (n-2)th and nth elements(Among the two greatest values), which can be thus chosen to satisfy the inversion parity.

            Note that say the two candidates for n-2th and nth values are x, y (x<y), then (x z y) and (y z x) would lead to always different parities of inversion, hence answer uniquely determined.

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

      Could you please elaborate?

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

    You can sort the even and odd groups by just greedily moving the minimum in the suffix to this position. You know everything is sorted right now except positions n and n-2 because you couldn't do the greedy strategy on them. If n and n-2 weren't in sorted positions (in their group) you know that group has 1 inversion and the other group has 0 inversions. Otherwise, you know both groups have 0 inversions. Notice when you're doing the swaps, the relative parity of the inversions in both groups never change. If they're different parities, they will always be different parities. If they're the same parity they will always be the same parity. So, if they have the same parity initially, you can never get 1 inversion in 1 and 0 in the other (the only possible choice is 0 inversions in both even and odd group). If they're different you can never get 0 inversions in both.

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

      oh I see... I think I get some idea.. thanks for sharing this.

      In the end I think whole trick was can you sort those last two elements or not.. and I think your idea is a very simple way to figure that out.

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

guessForces in C... no idea why spiral printing starting at center passed pretest LMAO.

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

    we would want 0 to be present in most of the subgrids as any subgrid without it would mex to 0, therefore we put 0 at the centre as this pos has the most occurrence of among all. now comes 1, we would like to put 1 such that the subgrid containing 1 and 0 are maximised, this would be subgrid 0 1, now comes 2 ,now we want number of subgrids containing 0 1 2 to be maximised, this can be achieved by enclosing 0 1 2 in a 2*2 grid, using this logic we can prove why spiral printing was the optimum sol'n.

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

      oh wow.. I think this makes sense.. so it was kind of for any cell count how many subgrids this is going to be part of .. sort it .. and then put number in reverse order or something.

      whoa thank you for sharing this .. I am sad that I didn't get any ideas for this.

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

        yeah, say our pos is (i,j), number of subgrids this would be present in is i*j*(n-i+1)*(n-j+1), this is because we have "i" choices from top to i, (n-i+1) choices from bottom row, w.l.o.g we can say the same for j.

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

          wow, so cool that you were able to think all this during contest time..hope you get positive delta and become higher rated than me.

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

    Didn't think of spiral printing specifically, but that example input, even for n = 3, was a massive hint.

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

guess work=accepted in C for me

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

first time I've seen a nice constructive problem :O

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

Great problems. Thanks

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

Can someone please explain C , i thought 0 should come in middle and 1 should always follow it
but kept getting wrong answer on pretest 2

this was my try :319285532

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

how to do div1C?

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

Instantly borrowed my own code at problem 2036D - I Love 1543 and saved implementation time at div2C.

»
16 months ago, hide # |
 
Vote: I like it -6 Vote: I do not like it

why make us think so much in problem div2 A, we want to be happy while starting the contest please

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

who else skipped C to solve D and then stuck at D and lose a lots of points ...

any second i felt im closer to answer of D but stuck after 1hr, realized i could solve C in less than 10 minute...

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

    how to solve C .. did you figure it out or you guessed printing the spiral way ?

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

      actually for any cell (x,y) i calculated how many subgrids exists which doesn't contain (x,y).

      because you know if we set positions of 0 to be (x,y), we should have most subgrids containing this cell ( otherwise their MEX would be zero )

      after finding how many subgrids exclude (x,y) minimized it using parabola's minimum formula.

      then you get x = (n+1)/2 and y=(n+1)/2.

      so i realized zero should be at center always, moreover, its subsequent numbers are better to be close to it, to maximize MEX for those subgrids containing zero cell.

      its not really a proof but it was my intuition, then i guessed spiral would be the best solution. submitted and it worked

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

    Exactly, every moment i felt i am close to solving D but i was yet too far away, and exactly opposite for C, it seemed too complicated but was really simple

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

    for D i only had 1 uncertainty about a[n-1] and a[n-3] ( zero indexed ). if i could somehow find them i could solve it. there was only two possibilities....

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

    In D I declare the BIT array globally for fenwick tree and wasted 45 min to debug.

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

Can someone give a hint for problem E?

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

What does the author wants to test by giving problems like Div 2 C .......

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

    I personally find it a nice problem.. It was intuitive to have a spiral matrix because that's how MEX would be maximised. Though; it also took me long time and various other guesses to come up to the idea..

    And this is not a coding test but a problem solving contest (nothing to be tested by the author). So, author wants to make an interesting problem not the one testing knowledge.. That's why guess work is also crucial at times !!

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

    guessing abilities T_T

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

Why do you announce results even though it is before systests xD?

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

hello, how can i improve to solve the problems? im new here

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

constructiveforces

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

C was the worst problem I have ever solved.

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

where tutorials?

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

Fun fact: the solution of 1693D - Decinc Dividing gets Wrong answer on test 2 in 2101D - Mani and Segments.

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

i was SOO distracted i +1 A and B :sob: but in the end i think i did alright, great contest!

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

In B of div1 and D of div2 why is my submission failing, i try to get the smallest number to front, and then recursively keep making the array smaller and smaller until no more operations are possible, I want to know my mistake before seeing the editorials answer.

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

    it seems you can still sort last remaining 3 positions if you do some swaps before doing the whole process you are doing.

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

how come we have winner list before system tests have finished ?

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

I wrote 3.24KiB for 1C :(

How did you solve this problem?

»
16 months ago, hide # |
 
Vote: I like it +35 Vote: I do not like it
»
16 months ago, hide # |
 
Vote: I like it -11 Vote: I do not like it

I like the problems, quality is standard div1 level.

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

One of the best CF problemsets I've seen in a while, huge congrats to the authors! <3

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

D глина, еле заслал

»
16 months ago, hide # |
 
Vote: I like it +72 Vote: I do not like it
»
16 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to D

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

Ama go volunteer back in the army cause WTF is the solution for Div 1 C lol?

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

What is the intended time complexity for Div1E? I implemented $$$O(N \sqrt{N} \log{N})$$$ solution with sqrt decomposition but narrowly TLE, so I think that there may be more efficient solution.

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

I was able to solve problem B but not A.. Can someone please help with problem A!!

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

    Think of this, say n is not divisible by p, now the sum of the entire grid would be (n/p)*q plus the sum of remaining n%p elements. You can clearly see we can achieve any sum of n is not divisible by p by having desired values of last n%p elements . Now take the case when n is completely divisible by p, here we don't have a choice, is (n/p)*q doesn't add up to m we cannot possible get this sum, as here we don't have the freedome to assign values to last n%p elements.

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

    Notice that the constraint on the segment sum essentially means that the values loop throughout the array over a period of p.

    Now, if n is not divisible by p, there will be only part of that loop (segment) at the end, which can carry the total sum to m, and the rest of the segment can compensate and bring the segment sum to q, so it's always YES. If n is divisible by p, then you don't have that extra flexibility, and the segment sum times number of segments must match the total sum. In other words, YES if q*(n/p)=m and NO otherwise.

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

My first time reaching the 1st page of the final standings omg

I'm so happy

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

    I don't mean to be mean but how does a guy with best perf top 1700 do ABCDF? There's no way you didn't use AI / do account sharing

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

      ABCD are all not really hard and at least 1000 participants worked them out, right?

      As for F, I don't think AI is so boring to make this silly solution actually, this is just simple binary search. If you want more details what have I thought:

      First, I found that all the cute subarrays has partial order under the inclusion relation. So in this case, one may notice that it's only needed to search all the maximal cute subarrays, using two-pointers.

      Second, still the property of partial order, you can use binary search to find the maximum right border when fixing the left border.

      After finding these 2 properties, I tried binary search. After passed the examples, I tried $$$n = 200'000$$$ random shuffled permutation (you may notice that there's a comment in main() that used freopen). But it resulted TLE. All the next things I did is just try something that may speed up, like recording low high array to speed up the inserting process, still using binary search for the deletion process. And it just happened that it worked, I can't even believing why it worked lol

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

You can see 319236013 clearly states // Extra vector added to reduce plagiarism.

Ban shubh1211

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

1C is much harder than 1D and 1F. that makes me have no time to solve 1F

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

I finished debugging my E one minute post-contest and it passed... :(

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

Nice round over all!

Thanks to the all the staff who helps to hold this round.

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

Is ternary search nlog^2n is one of the intended solutions for 1C? Then why the harsh time limit, I'm so tilted rn

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

    I also use the same time complexity in this. I use set and run 1140ms main test

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

Eyyy!! +60 for solving 3/6! Yeah!

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

Read 1D as 1693D, worked on it for 1.5h, and finally wrote the full code, until realizing I've read it wrong.

The most frustrating
»
16 months ago, hide # |
 
Vote: I like it -39 Vote: I do not like it

I have used an ai tool to generate code for printing spiral matrix for div2-C. I am not sure if it's within the guidelines. I got the logic by myself then i used an ai tool to write the code for spiral matrix.

Its mentioned here that If you're unsure whether a particular AI use violates the rules, please consult the competition organizers.

I want to know if this use is permitted or not.

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

    It is scrictly forbidden to use AI during a live contest for any purpose,all accounts for plagiarism

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

    That probably counts as cheating. There is a world of difference between boilerplate code for IO (that just gets the input in a manageable form for the algorithm) than using it for the implementation of the algorithm itself.

    Seeing at you submissions, it took you 30min to submit your first wrong program for C, after which you used AI (as you said in your comment) to get a correct implementation. Seeing that you found the implementation of your solution a challenge, you cannot argue that it's just meaningless boilerplate code. This is Competitive Programming, not Competitive Thinking: even though it's important to find the correct algorithm(s), finding a way of implementing them in a concise and fast way is part of the challenge. Using AI for that is, thus, cheating.

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

Here is a solution for Div1C / Div2E, which uses trenary search (seems to be alternative approach to what most people used).

Let k be the amount of distinct numbers in resulting array b. I.e. all numbers in b will be in [1, k] range.
For a known value of k the greedy algorithm can be used. Iterate i = k, k - 1, ..., 1 (i.e. downwards). At each step, use leftmost j1 and rightmost j2 elements which have a[j1] <= i and a[j2] <= i. It can be done in O(N*logN) using priority queues or a set.

To find optimal k, ternary search can be used. Submission: https://codeforces.me/contest/2102/submission/319299542

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

    Can someone help me why the solution which i submitted using Set fails but one which i submitted using priority queue passes. Set — https://codeforces.me/contest/2101/submission/319668536 PQ — https://codeforces.me/contest/2101/submission/319668295

    Shouldn't both take similar timings as both have TC of O(logN).

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

      I think it's expected behavior. My solution with set got 3781 ms result and the one with priority queues — 1092 ms. I see you use 2 sets (I used 1), so it will probably need something around 7500 ms. Priority queue is much faster than a set, it's a known fact, explained by how the elements are stored (vector versus a tree, where adding nodes require frequent memory allocation). Instead of using 2 sets you can use one: remove the "back" set. Instead of

      auto itrs = back.begin();
      

      use

      auto itrs = prev(front.end());
      

      etc. It still gets TL (on test 9 instead of 7). I managed to get AC with another optimization: golden section for ternary search. It passed in 3200 ms: https://codeforces.me/contest/2101/submission/319685824

      So, there is no bug in your solution with set. Red black tree is just generally much slower than a heap.

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

Just found a Random hustler the-raja who gave todays contest just for fun ,and above that he proudly boasts about in on his linkedin ,when I asked him about his apporach in D ,he replied with an AI generated response . The guy's post link on linkedin

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

Bashed 1D with sqrt + bitset: 319301576. I had like 6 bugs, so I didn't make it to the time...

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

I have $$$O(n)$$$ solution for D1.

Observation: if $$$p[1...n]$$$ is cute, then $$$p[1...{n-1}]$$$ and $$$p[2...n]$$$ are cute as well. So, we can use two-pointers to calculate intervals $$$(i, r_i)$$$, where $$$(i, r_i)$$$ is the longest cute subarray starting at $$$i$$$.

To do so, we have to maintain LIS and LDS in deque (to simulate two pointers), but notice that $$$(i, r_i)$$$ is cute, meaning that LIS + LDS $$$ = r_i - i + 2$$$ (this fact simplifies problem).

Since, we only considering cute subarrays adding $$$p_j$$$ to the back of the deque is easy, since LIS or LDS must extend by element $$$p_j$$$, and non-extending longest subsequence can only change its last element.

Deleting $$$p_i$$$ from the front of the deque is a bit harder, since it is possible for $$$p_i$$$ to be a beginning for both LIS and LDS. In this case, we can proof that after erasing $$$p_i$$$ we always can extend LIS/LDS in the front by the first element of LDS/LIS.

And the last case occurs when LIS = 1 or LDS = 1 (but not at the same time), in this situation the one having single element must change it to the last element of the other one.

My solution: 319304301

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

    I have a different $$$O(n)$$$ solution for 2101D - Mani and Segments.

    • $$$[l, r]$$$ is cute if and only if there exists $$$m$$$ such that all the elements in $$$[l, m]$$$ are either suffix minimums or suffix maximums, and all the elements in $$$[m, r]$$$ are either prefix minimums or prefix maximums. In this case, $$$m$$$ appears in both the LIS and the LDS, and the other elements appear in one of them.
    • For each $$$i$$$, find the maximum $$$m$$$ such that $$$i$$$ is either the suffix minimum or the suffix maximum of $$$[i, m]$$$.
    • Then, for each $$$m$$$, find the minimum $$$l$$$ and the maximum $$$r$$$.
    • Then, for each $$$l$$$, find the maximum $$$r$$$.

    All this is possible using next greater element and prefix / suffix min / max. My submission (319283002) is $$$O(n \log n)$$$ because I calculate next greater element with a set, but it can be optimized to $$$O(n)$$$ with a stack.

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

It seems like there is quite a large variance in judging time that can happen; during pretests my solution for C passed in 3840 ms, in system testing it got TLE on test 9, right after system testing finished i submitted it 2 more times and it got TLE on test 9 both times, now i submitted it again and it got AC in 3718 ms. A variance of 50 ms is something I'd expect but I had no idea there could be a difference of over 300 ms...

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

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

For 1B, I forgot to use long longs for counting inversions but it still ACed because overflow preserves parity :)

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

    I think several people still got WA because of this. I think they use %2 directly so for example -1 and 1 will get different result, thus they got WA.

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

Got wrong answer on Div1A due to wrong Spiral Printing Code on GeeksForGeeks. Somehow it prints the correct matrix for n = 2 and 3 (the sample test cases), and gives ridiculous output on n = 4 :(

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

    maybe don't rely on others' code to solve contest problems :D

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

      I mean it is allowed to do that. Also it was not trivial to implement so I thought, might as well take it from the internet

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

    I found printing the spiral backwards, starting from one of the corners, somewhat easier.

»
16 months ago, hide # |
 
Vote: I like it -24 Vote: I do not like it

Here are some of the top cheaters : [2ky], [LuOH3_] . Know more??? Add them to the list — justice awaits...

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

    Hey what are you talking about here?

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

      I'm talking about you. Just look at your rating graph — How is it even possible to reach Specialist in only 2 contests? And You reached Specialist in just 2 contests and solved only 11 problems in total ???

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

        Did my code look AI generated or what?

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

          Okay Well. But How it is possible being a Specialist in only 2 contests..??

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

            I don't want to be rude but... Practice hard and get better I think? I can just be lucky in this case. Getting first place is unexpected for me.

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

    I think you should just get gud, instead of wrongly accusing others for cheating.

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

When is editorial coming out

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

For div1C, is $$$O(nlog^2n)$$$ not allowed? I realized we can do it in $$$O(nlogn)$$$, but this $$$O(nlog^2n)$$$ submission passes in 4.5s while the time limit was set to 4s.

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

When solutions?

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

solution plz ToT

»
16 months ago, hide # |
Rev. 3  
Vote: I like it -7 Vote: I do not like it

Dear Codeforces, Hello, I am jitesh66, and my solution (ID: 319249391) for problem 2102C has been flagged for similarity with another user's submission.

I want to firmly state that this is completely my original work. The logic used — spiral traversal of a 2D array — is a well-known and standard technique. It's quite natural for different participants to arrive at similar-looking implementations when solving such problems, especially when the approach is straightforward and commonly used.

It is deeply concerning that such a basic and commonly taught method has been flagged as a violation. Just because two people wrote similar code for a standard idea doesn’t mean either one copied the other. How can it be assumed that I didn’t write my own code, especially when there’s no evidence of any unfair activity from my side? Even the editorial suggests spiral traversal, and I independently figured out and coded the logic on my own.

I did not collaborate, copy, or leak any part of my code. If similarities exist, they stem from the nature of the problem and the algorithm required to solve it — not from any violation.

I request a fair and thorough review of this case. Penalizing users for applying standard techniques undermines the spirit of the competition.

Thank you.

»
16 months ago, hide # |
Rev. 3  
Vote: I like it +1 Vote: I do not like it

All three of my problems for this contest have been skipped. I literally handwrote all the code and thought about the logic, investing a lot of time in it. My multiple solutions were incorrect on pretest 2, which I further debugged myself. Why were these solutions skipped? It undermines the effort I put in, and in return, I am told I copied someone else's code. Moreover, I received a notification for my problem C, but all of my codes have been skipped. It makes sense that, given the nature of problem C, implementing a spiral matrix can turn out to be a standard code; hence, it can be flagged, which is again incorrect but somewhat understandable. However, skipping the other two problems too literally makes no sense to me; that is a really wrong decision.

Kindly look into the matter. I have genuinely tried to perform well, and I don't want to be flagged as a user for no reason.

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

Three legendary coder for all time...

»
16 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

Dear Codeforces, Hello, I am deepiit.gupta, and my solution (ID: 319251371) for problem 2102C has been flagged for similarity with another user's submission.

I want to firmly state that this is completely my original work. The logic used — spiral traversal of a 2D array — is a well-known and standard technique which also has a question on leetcode (problem — 59) . It's quite natural for different participants to arrive at similar-looking implementations when solving such problems, especially when the approach is straightforward and commonly used.

I did not collaborate, copy, or leak any part of my code. If similarities exist, they stem from the nature of the problem and the algorithm required to solve it — not from any violation.

»
16 months ago, hide # |
Rev. 2  
Vote: I like it -8 Vote: I do not like it

Regarding Plagiarism Flag on Submission 319255450 (Handle: Athk_0312)

Hi Codeforces Team,

I'm writing about the plagiarism verdict on my submission 319255450 for Problem C from Round 1024 (Div. 2). My handle is Athk_0312.

I want to clarify that I didn’t copy anyone’s code or cheat in any way during the contest. The solution just involved filling the matrix in spiral order, which is a very common pattern. In fact, it's the same approach used in well-known problems like Leetcode 59 (Spiral Matrix II), so it's quite natural for different people to come up with very similar-looking code.

Since the logic is straightforward and widely known, it's likely that my code ended up looking similar to others. But I can assure you it was completely my own work.

»
16 months ago, hide # |
Rev. 2  
Vote: I like it -8 Vote: I do not like it

Regarding Plagiarism Flag on Submission 319274770 (Handle: agrawalheyramb)

Hello Codeforces team and reviewers,

I am Heyramb Agrawal (handle — agrawalheyramb), and my submisssion for Probblem C (Mex in the grid) is flagged for plagerism. I firmly believe that this is false positive, as I independently wrote the solution on my own. This problem can be easily solved using the standard spiral traversal of matrix. In fact, I had previously solved the spiral-matrix problem on LeetCode, which clearly predates the contest.

I am also attaching link and screenshot of my previous LeetCode solution of spiral matrix traversal. Link to Leetcode problem Screenshot of my leetcode solution

I humbly request the codeforces team to reconsider this flag.

[user:agrawalheyramb][submission:319274770][problem:C Mex in the grid][contest:2102]

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

three legendary coder in the world for all time...!

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

Subject: Clarification on Solution 319260324 for Problem 2102C

Dear Codeforces Team,

I hope this message finds you well. I recently received a notice regarding my submission (ID: 319260324) for problem 2102C, which is said to significantly coincide with another solution.

Regarding this ,I would like to clarify that I did not copy any code. After i got the idea that we should take the elements in a spiral, I took that code template from GFG.. This is the reference — _ https://www.geeksforgeeks.org/print-a-given-matrix-in-spiral-form/_ i just modified a bit and submitted this. The approach I used is a well-known and standard method for filling a spiral matrix, which is also commonly used in LeetCode Problem (I practiced it while solving Takeyouforward sheet).

I assure you that my solution was written independently. I kindly request you to reconsider the plagiarism flag, taking into account that the approach is based on a widely known algorithm.

Thank you for your time and understanding.

My Handle : "_Hadwik_"

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

eren__ can you share the checker code for d1A, Mex in the Grid

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

    Read the function f.

    Code