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

Автор DeMen100ns, 4 года назад, По-английски

Xin chào, Codeforces! (Hello, Codeforces!) ٩ (◕‿◕。) ۶

Me, FireGhost and SPyofgame are glad to invite you to Codeforces Round 779 (Div. 2), which will take place on Mar/27/2022 17:35 (Moscow time). The round will be rated for participants with rating lower than 2100. You will have 2 hours to solve 6 problems, one of which is divided into two subtasks.

In this contest, you will meet Kitagawa Marin and her friends Gojou, Juju and Shinju from My Dress-up Darling! We hope you will find our problems interesting. Good luck to you all! (ノ ◕ ヮ ◕) ノ *: ・ ゚ ✧

We sincerely thank the following people for their contributions in the round:

Score distribution: $$$500-1000-1750-(1250+750)-2500-3000$$$

UPD: Editorial

Congrats to the winners:

  1. tourist
  2. disorientation
  3. A-SOUL_Official
  4. Geothermal
  5. oleh1421
  • Проголосовать: нравится
  • +606
  • Проголосовать: не нравится

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

As a tester, f--k you SPyofgame.

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

Round is good.

Source: trust me dude I'm the authors' caretaker.

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

I'm only here because our beloved coordinator told me to

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

As a tester, I recommend participating in this round.

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

as a person who suffers from their goddang Marin cult (and because I'm jalsol), please give me contribution

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

As the person whose tasks were rejected by DeMen100ns, I strongly recommend participating in this round.

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

As a tester, please give me contribution. Try not to cringe as long as you can.

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

why are there always contests on usaco weekend :(

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

I want to be pupil. I wish I will reach the pupil as soon as possible. Good luck to everyone. I wish everyone will do well in this contest. And I wish all newbies will pupil.

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

As the results of Vietnam Olympiad in Informatics (VOI) are coming very near, I wish all of the problemsetters who participated in VOI a wonderful prize.

Edit: The same goes for all the other Vietnamese participants.

»
4 года назад, скрыть # |
Rev. 13  
Проголосовать: нравится +3 Проголосовать: не нравится
First time
»
4 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

hope that Marin won't cause me another trauma like VOI

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

goofy ass announcement made me skip round

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

My sincere appreciation for Marin Kitagawa <3

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

As a contestant f--k you SPyofgame

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

My rate-up darling!

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

We need an Emilia themed round in the future

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

Good luck and have fun.

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

I thought it was gojou from Jujutsu Kaisen :)

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

I start every contest hoping it will be better than my last. I hope I don't brick :)

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

Looking forward to this round, especially after I read, that there will be My dress up darling characters! Great anime, I recommend watching it! Good luck on contest!

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

Picture in the blog:

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

How are you going to make me choose between going to the gym and participating in this round.

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

Where's the gif from?

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

sus

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

why is everyone harsh on SPyofgame

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

RIP SPyofgame

rest in peace

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

DeMen100ns is so handsome

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

love you SPyofgame

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

Kitagawa Marin already hyped for this round. Good luck guys.

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

wuvforces.....

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

Judging by all the tester's reactions I think SPyofgame's problem statement had manga spoilers lmao.

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

Anime collab ? My delta definitely will be positive.

Marin is best anime girl of 2022, even, Gigguk said this ! Thanks to authors

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

Marin is the top, and the others are photoshop.

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

Uwwuwuwuwuu

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

Want to view all blogs on Codeforces? Check this out

https://mirror.codeforces.com/blog/entry/101288

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

It is going to be the cutest contest that have ever been on CF

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

Hello, I'm new here. What are the cutout ratings for the different divisions?

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

I hope that I can be master

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

permutationforces!

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

Is the name of problem D haiten code ??

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

hentaiforce

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

how to solve problem C ?

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

D2 should have worthed more.

Sad to see lots of people solved D2 ranked below people who don't.

maybe D1(750) + D2(1250) will be much better.

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

how to solve C?I struggle with it for more than an hour:((((

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

errorgorn should have rejected more problems

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

Hints for D1 (Easy): Precompute the number of ones at every bit position for first $$$N$$$ natural numbers.

Then, for each bit position, compare the expected number of ones and zeroes. If $$$x$$$ had 1 at that bit position, the count of ones and zeroes would have been swapped. If it had 0 at that position, it would've stayed same. However, it $$$cnt[zero] == cnt[ones]$$$, there's no way of finding out if any swap did occur. Hence, this bit position is, in some sense, free.

Finally, $$$x$$$ has to be present in the array, since $$$0 \oplus x = x$$$. Iterate over the array elements to return any element which does not violate the non-free bit positions.

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

    discovered the solution few minutes before the contest's end, guess that's what i deserve for arriving late to the contest.

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

    Using the idea of free bits, you can also solve D2. Just iterate over all subsets of the free bits and try to use them in the xor answer. If every number of the array remains between l and r, then you have an answer. You can check my submission.

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

    Are there proofs that any element in array which does not violate the non-free bit positions will be the answer ? It's clear that one of them will be the answer, but why any ?

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

      Suppose you found a valid $$$x$$$ with $$$i$$$-th bit free and does not violate the non-free bit positions. Suppose $$$x$$$ is $$$0$$$ in the initial array ($$$x = 0 \oplus x$$$). The $$$i$$$-th bit being free means that it has the same number of ones and zeroes on that bit. This happens when you initially had a prefix of a multiple of $$$2^{i+1}$$$ numbers, so in particular, $$$2^i$$$ must be in the initial array (you had at least numbers between $$$0$$$ and $$$k \cdot 2^{i+1}-1$$$). If you have $$$2^i$$$ in the initial array, then applying the operation gives you $$$2^i \oplus x$$$ which must be in the final array. This number only swaps the $$$i$$$-th bit of $$$x$$$, which was free, so it still does not violate the non-free bit positions. Therefore, $$$2^i \oplus x$$$ is also valid.

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

        Thanks very much. That was a great answer. I finally understood all only just now.

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

        condition: "If you have 2^i in the initial array, then applying the operation gives you 2^i⊕x which must be in the final array." result: "Therefore, 2^i⊕x is also valid." I can't understand the reasoning, why we can get the result from the condition, could you please explain it more detailedly?

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

          I reread my comment and you are right, there's something off with that. It was kind of a circular reasoning. Let's try again.

          We know that if $$$x$$$ is a valid answer, then it must not violate the non-free bit positions. We still don't know anything about the free bits, we know there is at least one solution, nothing else. This is a necessary condition.

          We want to check the sufficient condition, that is, any $$$x$$$ that does not violate the non-free bit positions is actually a valid answer.

          To show this, we first notice that $$$set(a \oplus 2^i) = set(a)$$$ for any free bit $$$i$$$, where $$$a$$$ is the initial array. That is, the set of numbers will be the same (still $$$[0, r]$$$) if we XOR every number with $$$2^i$$$, where $$$i$$$ is a free bit. Why? Because, as mentioned in the previous comment, if $$$i$$$ is a free bit, then the size of $$$a$$$ is a multiple of $$$2^{i+1}$$$, which means that for each number with a $$$0$$$ in bit $$$i$$$, the equivalent number with a $$$1$$$ (everything else the same) is also in the array. This proves the equality since XORing by $$$2^i$$$ just swaps pairs of numbers like $$$p0q$$$ and $$$p1q$$$, and they are all in the array.

          Now, suppose $$$x$$$ is a valid answer. Then denote $$$a \oplus x$$$ as the final array. From the previous result we then have $$$set(a \oplus (x \oplus 2^i)) = set(a \oplus 2^i) \oplus x = set(a) \oplus x = set(a \oplus x)$$$, which means that $$$a \oplus (x \oplus 2^i)$$$ generates the same final array and is therefore also a valid answer.

          From this you can set or unset free bits as you like, and in particular, you can unset all of them and you have the claim in the editorial.

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

So difficult div2

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

This contest is a rubbish

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

151135032 I submitted a random solution on D1 and it passed pretest. Does pretests weak ? UPD : FST :))

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

I was confident in solving C until I looked at todays third! : (

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

What does 388535 mean, the title of problems D1 and D2 ?

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

This contest is sponsored by permutations

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

...

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

How does it happen that I notice a difference between the statement and input format for the second time this month? Perhaps I could help you test these things in advance?

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

Can I say that I am in love with Marin Kitagawa? Thanks for your time.

»
4 года назад, скрыть # |
 
Проголосовать: нравится +29 Проголосовать: не нравится
This contest in a nutshell
»
4 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

The idea of considering parity and considering bits individually while solving bitwise problems really helps.

https://mirror.codeforces.com/contest/1634/problem/B

The above idea used in this problem helped me in today's D1 :)

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

can someone explain me why my code in d1 give runtime error on pretest2 ( look at the submission before the last one )

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

    You need to replace for(int i=0;i<n;i++) { at line 34 for for(int i=0;i<40;i++) { and you won't have runtime error. This was happened because size of arrays vars and need is 40 and if n>= 40 you are requesting a non-existent element of this arrays.

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

    Beside this I know, why your code gets TLE (Time limit exceeded). If it's interesting to know the reason, it is under the spoiler

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

Whoever decided the name for D problem is a true man of culture. Respect.

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

Got my answer

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

Sucks to solve more problems but still have a performance difference of +350 with someone solving less :/

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

I Accepted the problem C without understanding the justification for the solution at all...

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

I feel like D is a little bit too standard?

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

How to solve problem C ? (with proof of correctness please)

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

    you can shift input,to make first number in input 1(if there is not 1 answer NO),it means that N is first,then every next number can be at most one bigger than last(cuz after every shift by one in right it can increase not more than one .,u should check about there exist only one 1

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

    when in the given array c[i]=1, it means at that moment n will be the first element inside the permutation because c[i]=1 means the first element is greatest ,after c[i]=1 we r confirm that the lowest value of c[i] should be 2 because no other element greater than n will come in the beginning and the greatest value of c[i] should be 1 greater than the previous one because it is not possible to increase the value by more than 1 just by adding one number in the starting of the permutation . so we r having lowest and highest values , we have to just check either these are following properly from i+1 to n and then from 0 to i-1. just assume your permuation is having nth element in the starting and after that what can be the range of next c[i]..

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

    There is exactly one cyclic shift that gives $$$1$$$ (when $$$n$$$ is the first element). We can start from this position (let it be $$$pos$$$) and iterate in the right direction (cyclically) until we process $$$(pos-1+n)$$$ $$$mod$$$ $$$n$$$.

    Each iteration denotes the movement of all permutation values one position to the right (the last element comes first). Let the current power be $$$p$$$, the new $$$1^{st}$$$ element should either be $$$ \lt $$$ the new $$$2^{nd}$$$ element (increasing $$$p$$$ by $$$1$$$), or $$$ \gt $$$ the new $$$2^{nd}$$$, $$$3^{rd}$$$, ..., $$$i^{th}$$$ and $$$ \lt $$$ the new $$$(i+1)^{th}$$$ element ($$$i \lt $$$ the new position of $$$n$$$), which will give a new power $$$np$$$ in the range $$$2\le np\le p$$$.

    We can always construct a permutation satisfying the previous flow. Proof: Assume we represent each $$$ \gt $$$ or $$$ \lt $$$ constraint in the previous flow by an edge going from the larger to the smaller value. The resulting graph is acyclic and we can assign permutation values to its nodes by traversing in topological order.

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

How to solve E?

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

    Compute the answer for cells in decreasing order of $$$v_{i,j}$$$, starting from $$$n^2$$$ (the maximum $$$v_{i,j}$$$), for which the answer is $$$'M'$$$. Let's call each cell marked by $$$'M'$$$ so far, a winning cell. For every other cell, if there exists a winning cell having distance $$$ \gt k$$$, Gojou can jump to that cell after the first move, guaranteeing him a win. If not, Marin wins (and we mark this cell as 'winning'). Checking this condition can be done by maintaining segment trees for diagonals.

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

Interesting difference gaps. Not very easy Problem A, not very hard Problem F. But nice contest, thank you, problem setters.

However, I poorly misread "the cuteness of concatenated string" as "the sum of cuteness of all selected strings" in Problem F and got stuck into it until encountered those unbelievably brief solutions... I could have done better TwT...

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

If you are/were getting a WA/RE verdict on problems from this contest, you can get the smallest possible counter example for your submission on cfstress.com. To do that, click on the relevant problem's link below, add your submission ID, and edit the table to increase/decrease the constraints.

If you are not able to find a counter example even after changing the parameters, reply to this thread, mentioning the contest_id, problem_index and submission_id.

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

For the ones confused by name of problem D. Here is the meaing.

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

396419 this one is better. Or this one 396084. So much ntr stuff, nice!

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

When you try to cheat and google the name of problem D, then everything goes wrong -_-.

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

I was just wondering — in the announcement it says that the round would be rated for users under 2100. However, it says that the round was unrated for me. I looked around at other participants and it was also unrated for them.

Just a bit unsure of if its just a processing thing or if the round wasn't rated for anyone.

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

The problems are all about the "permutation"

how difficult!

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

f--k you SPyofgame

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

I just received a message from the system telling me that my solution(151118707) for the B problem is similar to notnotTehlka/151113394. I had reviewed the code of both the people; the fast io template of python is matching. Moreover, the solution was simple and trivial. So, Please look into the matter.

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

One of the most terrible rounds I have seen.

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

    Eh, why tho :< Can I have your feedback for better improvements in the later rounds ?

    It is the first time we set a round on codeforces so there might be some advantages we can further improve, some disadvantages that we need to learn to fix.

    I don't mind learning from feedback but I think you should go into detail about what made you annoyed.

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

If you cannot represent a problem with a clear concept DO NOT TRY TO DO SUCH NONSENSE!!

FACT Problem A

Never want to see you again in any contest @SPyofgame

.... you!

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

Could someone help me understand why this code is getting TLE? 151271702

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

The posts that say dirty words are placed on the top, while the posts that speak regularly are hidden.

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

My reaction to this contest blog on the front page:

Thanks for reminding me of the contest where I resubmitted to a question not knowing it skips the old submission and as a result lost tons of ranks due to it