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

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

Ahoj, Codeforces!

We are excited to invite you to participate in Codeforces Round 945 (Div. 2), which will start on May/17/2024 17:35 (Moscow time).

The problems are authored by TimDee and prvocislo.

This round will be rated for participants whose rating is below $$$2100$$$. Participants with higher ratings are encouraged to participate out of the competition.

You will be given $$$6$$$ problems and $$$2$$$ hours to solve them. The scoring distribution is bellow. One of the problems will be interactive. Please read this blog to get familiar with this type of problems.

We would like to thank everyone, who made this round happen:

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

Good luck, have fun and see you on Friday! ✩₊˚

Upd: Congratulations to the Winners!

Div 2:

1) _MyGO_Tomori_

2) Sxy_Limit

3) LofiGirl

4) prins

5) SXWZ-Queenie

Div 1+2:

1) BucketPotato with first AK!

2) gamegame

3) hitonanode

4) abc864197532

5) peti1234

Upd2: Editorial is out!

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

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

As a tester, I enjoyed testing this round. Also, satyam343 orz

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

As a loyal tester, I wish you all the best!

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

Hi! As a newbie tester I would encourage everyone to take part in this round and I would like to thank all the people who took part in organizing this round — especially prvocislo ! :D

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

Well done prvocislo, I am looking forward to Friday :-)

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

As a tester, I tasted so you could enjoy. GLHF!

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

As a tester, prvocislo TimDee and satyam343 put a ton of effort into this round. ORZ

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

LET'S GOOOOOOOOOOOOOOOOOOO

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

As a tester, problems are:

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

As a tester, I hope the participants will enjoy solving the problems as much as I did. Also, satyam343 orz.

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

romanticforces

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

Does CF allow someone who cheated (https://codeforces.me/blog/entry/120675) and never showed remorse for his actions to author contests? What I want is not that he shouldn't author contests ever, what I want is for him to apologize publicly and say that what he did was wrong, and maybe return the 2 TON he got from cheating.

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

    dramaforces

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

    MikeMirzayanov Can you please tell why no action was taken against him despite him cheating in many contests using alt accounts, and he never apologized or showed remorse for his actions?

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

      The perception among the top contestants is generally that using alts is not a bad thing, and I kind of agree with it (although Mike does not given that zh0ukangyang got banned, but that was probably a special case anyway, but I digress). It has a caveat though: You should never, and I repeat never, use two accounts in the same contest (obviously), which he has violated several times, and even worse than that, he has used two accounts in a contest with prizes, therefore effectively taking away one contestant's 2 TON.

      Of course, you could argue: "Well 2 TON is chump change, who the hell cares?", and I agree yes, this sort of mindset does have a place in certain situations, but not in this one. Why? Well for starters zh0ukangyang got banned even though all he did was take 3000 measly internet points from other participants, so it stands to reason that a person who takes 2 TON should have some action taken against him. Also, without all of that stuff, like cheating = bad???? hello??? a person who cheats should not get away scot free, like that's what I believe, maybe other people might believe something different, but yknow I've spoken my piece I guess

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

        Using alts is still cheating anyway, cos you're still taking some rating from other people. If you want to be against cheating, be against it fully.

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

          Yes, that is true. I personally don't have any alts, but I can see a ton of reasons why someone could create alts, the most frequent of which is that "I have only an hour to participate in contest, but I still want to participate". If CF introduced a feature like Atcoder where you can participate unrated, that would be great, and would probably reduce the use of alts by a lot.

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

As a tester, I tested!

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

as a participant i won't participate if problem C Or D is interactive

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

As a tester, I enjoyed testing this round.

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

As a tester I am afraid to say that I'm no longer a specialist to make this round special

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

Why is the time changed? I remember it started from 17:00 UTC+8

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

As a tester, the problems are of high quality and I would recommend the participants to read all of them.

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

It was my first time testing a round, I really enjoyed it, all the best for it!!!!

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

one of the problem will be interactive

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

Ok cheater

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

This will be my birthday contest :)

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

As a participant, I wonder why the time has been changed. It would start at 17:05 UTC+8 on May 16th when I registered.

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

Pray for Expect :3

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

Plz.start on 17:05(UTC+08) :<

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

GL&HF&high rating!

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

Lovers made me contest, Tim is fall in love with prvocislo. This contest will be a very romantic

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

Congratulations prvocislo, looking forward to your round :D

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

I wish everyone could reach their destination by this contest.Best of luck all the participants.

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

Today's contest in "Calendar" was scheduled: 15:05. I got ready and saw that: 20:35. Anyway I'm ready!!!

»
2 года назад, скрыть # |
 
Проголосовать: нравится +25 Проголосовать: не нравится
  • Codeforces Round 941 (Div. 1)
  • Codeforces Round 942 (Div. 2)
  • Codeforces Round 943 (Div. 3)
  • Codeforces Round 944 (Div. 4)
  • Any guesses?
»
2 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

A > B,C

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

Receiving clarifications for A about 7-9 mins into the contest after 1 failed attempt to answer the "original" problem is pretty underwhelming.

Bonus points for MASSIVE confusion after the first submission failed on pretest 1.

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

Anyone proved the validity of C?

I thought of a greedy solution, check if it's possible to maximize at indices $$$(3, 5, \dots, n-1)$$$ or $$$(2, 4, \dots, n-2)$$$, then take the case with better score.

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

    I skipped the sequence having a[i]=1

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

    As long as $$$1$$$ is not one of the chosen elements to be local maximums, then such construction will lead to values $$$\geq n+2$$$ for local maximums and $$$\leq n+1$$$ for other values.

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

    Just choose the case that ignore 1 cuz for example if n=8

    a-> ..8 1 7.. p-> ..1 8 2.. res -> ..9 9 9 ..

    which not valid solution..

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

    If one of them have better score, then the smaller-score one will have the element '1' inside it. The fact is that every elements will be at least n + 1 after the transformation. So if the we try to maximize the position having the element 1, it couldn't be the local maximum.

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

    Take the one with n or if n is on the edge, take the one that is further away from n.

    If you take the one with n, worst case, you have to maximize 1, 2, 3, ... n in order. To 1 let's match up n in ans permutation and to 2 let's match up n — 1 and so on and so on. The minimum sum we can get is n + 1, n + 1, n + 1 ...

    To be sure they are the local maximums, the worst case scenario of the neighbors are that they are n — 1, n — 2, n — 3 ... to n — 1 let's match up 1 in our ans permutation, to n — 2 let's match up 2 to n — 3, 3 ... and we see that our neighbors are n, n, n in the worst case. Since n + 1 > n, this works.

    There is similar logic when n is on the edge.

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

    Since it is even you can always achieve the optimal number of local maximums in an array. The only thing you need to watch out for is to make element N, a local maximum, and if you do that it can be proven that every element that is supposed to be a local maximum will be >= N+1 and every other element < N+1. Just add 1, 2, 3, 4.... to local mins in increasing order so at worse that would be (N-1)+1, (N-2)+2 ... you can see that each is at most N, and do the reverse for local maxs 1+N, 2+(N-1) ... each is >= N+1.

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

good round

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

is it just me or was C kinda tough to implement?

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

Almost toughest Div2. BCD are too hard for their positions and D is the strangest problem of my CP journey...

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

How to solve C?

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

Proud of myself by solving C with proving its validity, not by guessing

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

how problem B was solved?

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

my hardest div.2 till now

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

can anyone explain the approach for problem-C ?

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

    1.Divide the array into halves based on even and odd index.

    1. Find which half has 1 (this is the half without maxes), you could do half that has n is maxes, alse.

    2. Sort both halves.

    3. Sort sides with peaks. Put n/2 + 1 to n in this half. Smallest number in OG array gets largest number in new array.

    4. Same as above with array without peaks but with 1 to n/2.

    5. Print

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

please don't give spoiler

in problem D.
we can find max element a_max in n queries 
the ans m will be some multiple of a_max there will be n such possible values of m but don't how to check them all in rest n queries

please tell me if im in correct direction and need some more observations
or im too far from the soln. Thanks!

upd : got AC, we only need check first n / k multiples of a_max

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

Worst A ever!!! A > B

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

A: I guessed we should greedily remove (1, 1) from 2 highest score until there is 0/1 positive score left.

B: I guessed it's binary searchable.

C: I guessed only considering position 2 and 3 is sufficient.

D: What should I guess? XD

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

Author please tell me why interactor not giving maximum element in the array for sample test case 3 for the following code.

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

got TLE for problem B

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

how to solve D?

  • »
    »
    2 года назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится +6 Проголосовать: не нравится
    1. Use n guesses to find largest element in array. Can be done by guessing ? n s*n for s in range n to 1. s is the largest number in array

    2. If m exists m must be a multiple of s. m must also be a maximum of s/k, because anything greater cannot exist as m=s/k, divide array into k equal parts if all elements in array are s.

    3. Can brute force with those 2 observations. n/k solutions to check. Each solution takes at most k queries.

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

    Find the maximum element $$$mx$$$ in $$$a$$$ by making queries $$$(1,n*n), (1,n*(n-1)),\dots$$$. If you get $$$r=n$$$ on query $$$(1,n*b)$$$ then $$$mx=b$$$.

    Now since this maximum element is present in at least one of the $$$k$$$ subarrays, $$$mx$$$ must divide $$$m$$$. Also, if $$$m=b*mx$$$, every subarray must have length at least $$$b$$$. So we only need to check multiples of $$$mx$$$ upto $$$\frac{n}{k}mx$$$. In each candidate for $$$m$$$, just query $$$k$$$ segments starting from position $$$1$$$ and check if these segments cover the array.

    This takes $$$n$$$ queries to find $$$mx$$$ and another $$$n$$$ queries to check all values of $$$m$$$.

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

It was the most fun Div.2 ever, thank you!

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

Mannn.. wasted 20 min on a corner case in problem A. and wasted almost 1 hr on a simple mistake in problem C.. as well as 4 wrong submissions, giving a heavy penalty... But overall the questions were amazing.

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

C is too bad

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

Finally i have reached master

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

My easy solution for A:

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

Terrible problems.

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

The assumption of finding the maximum value of the array in problem D was nice.

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

Terrible contest...

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

Finally I find my lucky contest lol :>

Waiting for another even luckier contest to push me to CM :>

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

I'm newbie in here, can someone explain why in the problem A test case 1 => 3, 4, 5 the answer is 6. If i count manually i just can make the max of draw is 5. With the following operation:

  1. A & C draw so 1, 0, 1
  2. A & C draw so 2, 0, 2
  3. A & C draw so 3, 0, 3
  4. B & C draw so 3, 1, 4
  5. B & C draw so 3, 2, 5
  6. then B win so 3, 4, 5

I cant find if the max draw is 6 T_T

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

Is it just me who solve A with a naive dp? Can't even come up with any solutions now xD

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

I don't like to guess T_T

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

Sooo fast rating updation!!!

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

Hi all!

Can someone help me figure out what happened with my B? I solved it using C++20 in my machine (the tests where matching) then I submitted my code to CF and got WA on test case 1. I looked at the results on the submission and one test was different from what I got locally.

Then I switched to C++17 on codeforces, submitted my code again and got AC.

What might be the problem? What I think is weird is that I was also using c++20 locally and there was no problems.

AC submission (c++17): 261375967 WA submission (c++20): 261374878

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

This C solution seems simpler than the other ones I've seen. Just take some set of nonadjacent (n-2)/2 elements to make as peaks such that none of the taken ones are equal to 1. Then, you can force those positions in the array a to have values >= n + 2, while forcing all other positions to have values <= n + 1, which guarantees that those become peaks.

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

got skill-issued, and somehow increased rating lol

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

A bit tougher than usual Div2, but the problems were amazing.

I felt B > C, especially proving that binary search works in B has taken a lot of time.

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

BUCKETPOTATO ORZ

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

Pretest Exactly Maintest WOW!

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

Very nice round!

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

На самом деле ABC — интересные задачи. Но вот ошибка в переводе, которая полностью поменяла смысл задачи А — очень сильно испортила впечатление...

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

A little difficult, but absolutely a nice contest and high quality problems.

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

'B' was quite tough compared to usual div-2.

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

Great problems!

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

Hello there! I had a funny little solution for B which involving Segment Trees.

My code : 261728503

Solution :

Hope you understand the solution, if you have any queries feel free to ask, and I'll try to help if possible.

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

I think problem D,E are both clever and interesting.

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

really cool round! Problems have quite short and nifty codes and the ideas are really cool. well done on setting D and E (especially D)

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

This is the first time I am experiencing rating decrement after roll back!!!