_LeMur_'s blog

By _LeMur_, 13 months ago, In English

Hi, Codeforces!

I'm glad to invite you to take part in Codeforces Round 917, which will take place on Dec/24/2023 17:35 (Moscow time). Round will be rated for participants with rating less than $$$2100$$$. Participants from the first division can take part out of competition.

There will be $$$6$$$ problems for $$$2$$$ hours. The problems are authored by IgorI, zidder and me.

Part of the problems in this round were in the Yerevan SU 28.1₀.₂₀₂3 Contest. If you participated in it or know at least one problem from it, please refrain from participating in this round.

We would like to thank

Scoring distribution: $$$500 - 1000 - 1500 - 2250 - 2500 - 3000$$$

We hope you'll like the problemset! Good luck and have fun!

UPD 1: Editorial

UPD 2: Congrats to our winners:

  • Div1 + Div2
  1. tourist
  2. Sugar_fan
  3. BurnedChicken
  4. Rubikun
  5. kotatsugame
  • Div2
  1. -Misaka-Mikoto-
  2. _chashuibiao_
  3. needy_and_sorry
  4. Godjob
  5. LordVoIdebug
  • Vote: I like it
  • +281
  • Vote: I do not like it

| Write comment?
»
13 months ago, # |
  Vote: I like it +1 Vote: I do not like it

]

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

Great!!!

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

As a tester, I recommend trying all of the problems (really good ones). Also I wish everyone positive delta as a Christmas present:)

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

I will try it!

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

^_^

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

As a tester, I want to reach pupil after this round

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

Looking like speedforces:( because D is 2250.

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

hggnigan This round is good?

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

CM TIME

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

Big point difference between C and D

»
13 months ago, # |
  Vote: I like it +3 Vote: I do not like it
╱|、
                      (˚ˎ 。7  
                       |、˜〵          
                      じしˍ,)ノ
»
13 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Hopefully I become a master after this contest!

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

Maybe I can reach specialist by the end of this year :)

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

    Mate you just missed by 2. Maybe in rechecking later it may increase.......

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

      Yeah, was almost there... maybe next time

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

      And I'm confused how the hell on earth did your code for problem C got accepted...I just copied and ran your code and it's showing WA on testcase 38

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

        Can you tell me what did you change to get it accepted?

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

          Just ran the outer loop till d rather than min(d,max(n,k) and then checked inside the loop if n+(d-i-1)/2<=current_answer then simply break as checking beyond it wont give the maximum answer. Because the max n can go upto is 2000 where as d can go till 1e9.

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

            I found that if I run the loop till min(2*n,d) it works.

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

As a tester for the 1st time,i feel proud.

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

Yo

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

Hope to become Expert.

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

I will finally give a Cf contest. Lets go.

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

As a contestant,I want to reach pupil after this round btw

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

best wishes for every one

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

Clicked me now, why all are LGM here

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

As a kawazaki I will participate

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

AbduSaber First tester from Sohag, Egypt :) , remember this name very well -_- .

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

Hope to solve all the problems!

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

As someone who has a birthday, please give me a contribution.

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

Really weak sample for C. Is it fun to see players wa2 again and again?

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

Hope will become expert

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

unbalanced forces !

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

Defeated by constructive round. so sad.

update: now I'm defeated by the FST XD

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

Am I missing something or does D effectively boil down to:

  • Calculate inversions within P.
  • For each i, calculate number of values in P which would be its inversion for relative power shifts between -20 to 20.
  • Iterate over values of Q, and check how many occurances of [Q_i — 20, Q_i + 20] lie before it and add them to the answer.

I spent 15-20 mins thinking of how to simplify this to something I could implement without going insane before giving up and going to problem E instead...

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

    Had the same idea, how are you calculating the inversions for relative power shifts? My approach ended up double counting many things

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

      I didn't implement it because I felt it would be an utter mess. As I mentioned I just gave up and went to solve E instead.

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

    You don't need to simplify this to anything else. You can calculate this directly

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

      I mean "simplify" the implementation so I don't go insane implementing this. I seriously doubt I could code this in less than an hour with all the debugging from minor mistakes that are likely to occur. It feels like a 10 mins to think, 1 hour to code problem.

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

Whoever made C deserves lifetime sentence in jail.

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

    What's wrong with it, I think it is a really good problem for Div2 C?

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

    beta detected opinion rejected

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

How to approach B?

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

    Sum of the first occurrence of each character is the answer. Suppose we have s = "abeakf". Then if we consider 'a' is the first character, we will have ["abeakf", "aeakf", "aakf", "akf", "af", "a"]. We only need to care about the first position of character 'a' in s, because if we tried to used the second 'a', the result string will be duplicated (these are "akf", "af", "a")

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

    Essentially, the only difference between strings after "i" operations is the first letter. That's because you can't reach the other characters through these operations. However, that initial letter could be any letter present in the prefix of length "i" of the original string. So, you calculate the number of unique letters in each prefix and then sum them up. That's basically the answer.

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

    check the string from left to right, if i th character has not appeared before, answer += n-i

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

    I thought of that in this way. Suppose you have a string "ayush",now if you want to find all the strings of size '4', "ush" will always be there so the string will be "_ush" now for the first character look at how many distinct characters we have encountered before we reach 'u' (2), so there are two possible choices for the first character. Do this starting from size 'n' to size '1'. Hope this makes sense to you!

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

still don't know why in C, when I tried to iterate min(n, d) times, it gave me wrong answer, since I thought it is enough to make the array big. I used a large number instead like min(5000, d) and got AC.

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

    i did min(3*n, d)

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

      why?? can you explain why calculations after 2*n/3*n will be waste??

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

        Suppose we have:

        A = [N, 1, 2, ..., N-1]
        V = [1] * (2N-5) + [N]
        

        Then after (2N-5) + 1 operation (1), we have:

        A = [3N-4, 2, 3, ..., N]
        

        where 3N-4 = N + (2N-5) + 1.

        Apply operation (2) to score N-1 in (2N-4) + 1 = 2*(N-2) + 1 < 2*(N-1) which beats the alternating method from the zero array.

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

          This seems much like a case specific example. How can you guarantee that the claim is true for any A and V ?

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

            All the calculations from an initial array A only result in a single scoring operation before it gets reset to zero.

            As stated in the comment below, the largest score we can get from a single scoring operation is N — assuming every element satisfies the criterion.

            Calculations taking strictly more than 2N moves are not better than scoring immediately (ie. transition to zero array; if needed) and then alternating operations 1 and 2, scoring N.

            I produced the earlier example to show that in some case, we cannot perform much fewer than 2N moves either.

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

              Oh, I get it now. Thank you so much.

              UPD: I would like to explain mathematically (that's how I like to go about it). Let's say you have done operation 1 for the first $$$X$$$ days, and for the rest $$$(D-X)$$$ days, you'll perform both operations alternately. So your total score would be $$$S + (D-X)/2$$$ where S is atmost N. If you had performed alternating operations from the start, you would have scored $$$D/2$$$. Now, my prior answer is better only if:

              $$$\frac{D}{2} < S + \frac{D-X}{2}$$$
              $$$\Rightarrow X < 2*S$$$

              Hence, you will get the most optimal answer in the first 2N days because S could be atmost N.

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

                You can't get $$$d/2$$$ in general case because if you start alternating ops from day 1 you'll get $$$initialScore + (d-1)/2$$$. Proof: 238854323

  • »
    »
    13 months ago, # ^ |
    Rev. 4   Vote: I like it +12 Vote: I do not like it

    $$$n$$$ is not sufficient. You can raise the answer by $$$1$$$ in $$$2$$$ steps using operation 2 but operation 1 can add upto $$$n$$$, so you need to check for the first $$$2 \cdot n$$$ steps.

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

    I can proof. You actually need to do not 5000, but 4001 (additions). Because if you do 4002 additions and get 2000 score as return, you could have also done 4001 for 2000 score with the strategy — do one addition — cash the score

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

    It don't know understand why you need to do that , main thing is that only 1 such position is possible after 0-array , so brute force till k , then all will give 1

    for(ll i = 0; i < k ; i++){
         ll cnt = 0;
         for(ll i = 0; i < n; i++){
           if(a[i] == (i+1)) cnt++;
         }
         ans = maxm(ans,cnt+((d-i-1)/2));
         for(ll j = 0 ; j < v[i] ; j++){
              a[j] += 1;
         }
      }
    
    • »
      »
      »
      13 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      but k is at most 10^9

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

        no , sum of it over all t is given <= 10^5 . re-read the question

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

        if k were to be 10^9 , then how would it be even possible to take v input

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

      why iterating over first k days will work?? is there any proof of it ?

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

        nah , it FST'ed :( it should've been min(d,max(k,n)) , then it AC

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

I tried to solve B using DP, but got Memory Limit Exceeded at test-case 3, anybody else tried it using recursive DP, or DP?

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

    I tried that too I reversed the array and used a stack dp but when I calculated the space complexity I was kinda convinced it would give me MLE so I tried a different approach

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

how to solve 'B'!!!

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

what happens if you submit right answer twice for pre tests?

i submitted D twice to avoid tle later.

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

    Your second submission, and its submission time, is used. You are also penalized as if the first submission was rejected.

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

Can anyone check why my code for C is wrong? I have been staring at it for 1+ hour and couldn't find the problem.

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

    In the last 'for' loop, you are checking for the valid indices only till b[j]+1. You need to check the whole array.

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

      Oh my bad, that was a last 15 seconds desperate attempt, I meant the one before that where I have b[j] instead of b[j]+1.

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

    i think when u added to the first b elements in the array, you checked if an element became "good" meaning that a[i] = i but not if an element is now no longer "good"

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

      Ohhhhh I didn’t check for good elements after b[j]. So sad. Thankss!

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

C is greedy af

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

I have skill issue.

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

The problem set is crazy :)

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

D always getting wrong answer on pretest 5, what a sad Christmas Eve :(
BTW, could anyone please tell me what's wrong with my code 238736754 ?

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

    Oh I see, forget to take those power of 2 exceeding ±20 into consideration ...

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

Not putting N = 2, K = 2 in the samples of E is cold-hearted lol :P

Also imagine debugging WA on E for 15 mins after "handling" this case just to make this fix and get AC ._.

Image
»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Couldn't solve $$$C$$$. How to learn to notice all, what needs to be noticed?

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

    You don't need to do so. Its just that after you do a reset operation then you can't get score greater than 1 after any number of operations. So its optimal to take a score of one from first element greedily after doing 1 reset operation

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

      Surprisingly, I noticed this.

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

        Lol I noticed it too and didn't solve C. I tried two +- different ways, but both have WA2 on pretests. I was only 10 points away from CM, sad :(

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

    How many can you get from first reset op?

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

    Here is my solution by the way, which didn't passed probably because of bug in implementation.

    Fix an element in array $$$a$$$. I want to know, when it is good, i.e. $$$a[i] = i$$$. If $$$a[i] < i$$$, then after some movements on array $$$v$$$ it will become good, then it will become bad forever. Sounds like scanline. Let's calculate for all elements of $$$a$$$ the segment of numbers of operations of type 1 after which the element is good. Process them in decreasing order. Fix $$$i$$$. Then all $$$v[j] \ge i$$$ change element $$$a[i]$$$. I want to know the position in cyclic array $$$v$$$, after which $$$a[i] = i$$$, i.e. I want to know $$$(i-a[i])$$$-th element of array $$$v$$$ with only elements which $$$v[j] \ge i$$$. Assume, they are in some structure. Let there are $$$x$$$ satisfying elements in array $$$v$$$. Then I need to traverse the whole array some number of times, and them some prefix. So I need to be able to find $$$k$$$-th element. I can do it with Cartesian Tree (Декартово Дерево), or with "indexed set" (google "cses.fi Josephus Problem II").

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

div1 difficulty

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

Can someone pls explain an approach for C?

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

    My English is not good,in my opinion,the sequence is like stairs,because it can be added to ans when it equals to it position,so every time you do opreation [1,b[i]] +1,it will break the stairs,so if 1-n is 0,only 1 or 0 can be added to your ans after several +1 opreation. To be the best,you can do opration 1 once and do opration 2 once.In this way you can add 1 to ans for two oprations. after understand it,you can make a brute force on array 'a' to Calculate the best ans. it will be allowed on O(n*n) , you can according to my ans 238725053. I Hope i can help you.

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

      Thank you much. I understood your solution) But there is one question. Why do you brute for i <= min(k, d-1). Why not further?

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

        oh god,i'm wrong ans on test 26 Hhhhhhhhhh,i think you need a better person explain for you

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

Thank you for spoiling the mood for the new year :(

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

Codeforces ------- NO
Speedforces ---- YES

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

why we need to check 2*n instead of n in C?

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

    really? how do you know

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

      The max score u can have before 1st reset is n. In 2*n days, using the reset operation u can increase your score by n.

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

    Yes because if it doesn't get give better result in this range there's no way it will give better if it's more since you can increase the score by 1 in 2 steps. I didn't realise that and checked way more than this by throwing and got Ac

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

    Here is a case where checking up to $$$n$$$ fails:

    1
    4 3 6
    2 0 1 2 
    1 4 1
    

    Only optimal solution is doing op 1 five times then op 2.

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

      After doing op1 5 times the array is [7 2 3 4] and doing op2 => answer is 1

      But that is not the optimal solution

      [2 0 1 2]

      op2 => answer = 0 [0 0 0 0]

      op1 => [1 1 1 1]

      op2 => answer = 1 [0 0 0 0]

      op1 => [1 1 1 1]

      op2 => answer = 2 [0 0 0 0]

      op1 => [1 1 1 1]

      Answer is 2

      Did I understood this right?

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

        Doing op2 on array [7 2 3 4] gives 3.

        Op2 counts the number of indices $$$i$$$ where $$$a_i = i$$$, in this case 2 3 4.

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

    more like max(n,k)

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

optimizing knacksap with bitset is uninteresting

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

I think div2 B should be easier or I'm not participate enough

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

    me too, I felt than C even easier than B.

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

Please explain why tourist's solution to problem C 238680690 passed the time limit. I think the condition in the for loop is doing the optimization, but I do not understand why.

for (int u = 0; u < d; u++) {
   if (n + (d - 1 - u) / 2 <= ans) {
     break;
   }
   ...
}
  • »
    »
    13 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    d can be upto 1e9 which goes way above the constraint

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

    If n + (d - 1 - u) / 2 <= ans then this and the future iterations are useless since they won't improve the answer. And since the initial ans is $$$\frac{d - 1}{2}$$$, any value of $$$u \ge 2n$$$ will be useless. Therefore, this cycle performs at most $$$2n + 1 = \mathcal O(n)$$$ iterations.

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

noting to say, but good night

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

min(n, k) gave wrong ans so i submited it with k i forget about k = 1e5 after wrong ans test 3 now waiting for fst :( now +60 will turn int0 -60

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

    You don't get FST because $$$k$$$ is large, you get FST because checking the first $$$k$$$ days is not enough.

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

      bro why is there no pretest regarding this. btw thanks for yesterday's contest problems were really interesting even though i didn't get them during contest but i enjoyed during upsolving them

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

E: You are given an even integer n and an integer k

I missed the "even", I would have been able to solve it if I noticed that. Now I think I have a working solution for the odd n. Could have been a nice E1 and E2 problem.

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

    Yes, I didn't think a lot about odd $$$n$$$, but yes it's solvable (check Bonus in the editorial for the problem E)

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

    Ohh What fresh hell is this !!

    Really feels bad when you misread the problem.

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

This contest was OVERKILL for me :(

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

Why did my solution to C pass? I don't understand why it works.

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

C became a scam

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

Can anyone tell me what's wrong with my code for task C? I have WA2 and O(n * log^2 k) asymptotics. 238736328

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

You guys were solving B with a set?

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

Why so many solutions fsted on C?

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

    They simulate the process from $$$1$$$ to $$$k $$$

    However we should simulate from $$$1$$$ to $$$2n+1$$$

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

      Can you explain why $$$2n + 1$$$?

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

        If we do $$$x$$$ updates before getting the score $$$c$$$ in the $$$x+1$$$th step , the total score is $$$c$$$

        But if we perform the operations normally (for a 0-array) the contribution will be $$$ \lfloor\frac{x}{2}\rfloor$$$

        Than it is optimal to make updates in which $$$n\geq c\geq \lfloor\frac{x}{2}\rfloor$$$

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

      Is it because I would have gained $$$n$$$ points in $$$2n$$$ days if the array were reset to 0. The maximum I can gain from an array is $$$n$$$ points and doing it beyond $$$2n$$$ days is wasteful.

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

    min(2n,d) may be greater than k.

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

I love this round.

I love the super-weak pretest in C, which make me fst.

I love the interesting problems C and D, which made me stuck in implementation and debugging.

I love the random constructive problems taking the place of E and F, which makes the diffculty distribution so unbalanced and weird.

Oh. How I love it.

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

    F is not constructive and implementation of C is very short. About weak pretests, I'm sorry.

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

Thank you for the weak test cases for problem C.

Now I can reach Expert with the help of FSTs.

By the way, thank you for the awesome round!

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

I wasted 15 minutes because I put n instead of 2n as the limit of days to use second op in C, but least my n log²n D didn't TLE'd and I'll need to use magic to become purple again :)

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

my color changed twice in 2 contest :D

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

Not inserting a test into the pretests for one of the most possible error patterns in C is a bad Christmas gift.

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

c

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

A to C was fine. but D was too much

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

actually 2n days will give n points so if we waste 2n days then automatically we will get the max value i.e. n so if we are acquring n points after 2n days it is a waste its better that we just do the second operation then

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

Merry Christmas everyone!

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

Thanks for round! Tasks were really cool.

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

Beautiful problem F! Thanks!

»
13 months ago, # |
Rev. 6   Vote: I like it +8 Vote: I do not like it
I have a different solution for D than the intended one :p, and doesn't use the fact that p is a permutation

Here is my code : 238726631

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

In Problem C: Checking over the v sequence only once was enough to pass pretest. At least this major corner case should have been included in pretest which is in test no. 26 :(

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

test 26 of problem C is like the grinch :(

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

I liked Problem E very much, thanks _LeMur_! I upsolved it. My idea with 6 was following: if k is small, then print the diamond of 6 ones on the first 3 lines of matrix, then fill squares of 2x2 on the following lines. And symmetrically opposite: if k is large, then subtract k = n*n - k, and do the same with inverted bytes.

Somehow my Perl code is running notably fast. Submission — 238764454.

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

    Problem E-bonus (n can be odd):

    Solution.
    • »
      »
      »
      13 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yes, Nice! It's correct. I am happy that you liked the problem :)

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

C is really good but i didnt solve it during the match TwT

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

Guys,my rating for recent educational round was taken back.Is there anyone who is having the same problem?

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

    That's because you cheated the contest ...

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

      It seems the same incident happened for you.Have you received the email of plagiarism detection too?