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

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

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
  • Проголосовать: не нравится

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

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

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

    Can you briefly explain, what testers do?

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

      They just enjoy testing the round, as he had said.

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

        So they solve all problems before the contest? Is this testing? If it is then it's quite cool!

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

          Pretty much. You do the round before it is held and give feedback to problem authors. You can also upsolve and give suggestions and feedback to authors even after testing. Basically helping with problems as it's much easier to make good problems when you have opinion from a lot of people.

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

          It's what you mention — with some goals; broadly, there are two types of testers:
          - those that give the contest and opine on the overall quality (difficulty gradient/topic bias etc)
          - those that scrutinize the problems in detail, evaluating all aspects of the problem; its difficulty, constraints, wording, test-quality, some go the extra mile and test to make sure that poor solutions don't pass (though I believe this falls on part of the setter)
          At times, there is also an overlap of the two; after evaluating the contest as a whole, a tester can also individually scrutinize problems in detail.

          Most Importantly
  • »
    »
    5 недель назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится
»
5 недель назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

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

»
5 недель назад, # |
  Проголосовать: нравится +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

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

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

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

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

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

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

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

LET'S GOOOOOOOOOOOOOOOOOOO

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

As a tester, problems are:

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

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

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

romanticforces

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

Does CF allow someone who cheated (https://codeforces.com/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.

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

    dramaforces

  • »
    »
    5 недель назад, # ^ |
      Проголосовать: нравится +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?

    • »
      »
      »
      5 недель назад, # ^ |
        Проголосовать: нравится +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

      • »
        »
        »
        »
        5 недель назад, # ^ |
          Проголосовать: нравится +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.

        • »
          »
          »
          »
          »
          5 недель назад, # ^ |
            Проголосовать: нравится +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.

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

As a tester, I tested!

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

World Telecommunication Day !

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

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

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

    as another participant I don't think this is a wise decision. If you don't attempt harder interactive problems you will not improve at them.

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

As a tester, I enjoyed testing this round.

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

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

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

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

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

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

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

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

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

Hopefully, the problem statements will be short & precise just like the announcement! :)

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

one of the problem will be interactive

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

is it rated?

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

Ok cheater

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

This will be my birthday contest :)

»
5 недель назад, # |
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.

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

Pray for Expect :3

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

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

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

GL&HF&high rating!

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

Thank you all for organizing this. Hope i can manage to solve up to problem C.

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

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

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

Congratulations prvocislo, looking forward to your round :D

»
5 недель назад, # |
  Проголосовать: нравится -22 Проголосовать: не нравится

romantic forces 🤡

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

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

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

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

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

A > B,C

»
5 недель назад, # |
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.

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

.

»
5 недель назад, # |
  Проголосовать: нравится +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.

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

    I skipped the sequence having a[i]=1

  • »
    »
    5 недель назад, # ^ |
    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.

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

      I see. This claim seems to assure that my solution is correct (yet slightly redundant as excluding $$$1$$$ is done only at the final comparison). Thank you.

  • »
    »
    5 недель назад, # ^ |
      Проголосовать: нравится +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..

  • »
    »
    5 недель назад, # ^ |
    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.

  • »
    »
    5 недель назад, # ^ |
      Проголосовать: нравится +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.

  • »
    »
    5 недель назад, # ^ |
      Проголосовать: нравится +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.

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

good round

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

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

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

PTSD

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

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

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

    Lol I thought I was the only one thinking B was odd. Counting prefixes bit-by-bit should be C at least.

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

      I didn't count prefixes. I just split the numbers into bits and found the length of the longest sequence of zeroes in the resulting arrays.

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

        Exactly, just sort the indices of elements with each bit and take the max difference between them, no need for prefixes or binary search or anything similar.

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

        Ah, I see. I must have done dumb things under pressure. XD

        Still, bitworking for B does seem overboard a little bit. Maybe 1250 is a more proper score for it.

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

          I get what you're saying, but nothing compares to having an incorrect russian A statement to me. Wasted 10 mins because of it, more than i spent on B.

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

            That part, I could empathize with (though I escaped it since the English ver did justice). Kinda sorry for your bad luck there.

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

          Same lol, I used Sparse Table and Binary Search. Ig I really over killed it.

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

    Out of curiosity, what makes D so strange in your opinion?

    It feels fairly normal for a CF interactive problem to me.

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

      The interaction and the output format is very weird. What I expected: I can ask $$$l, r$$$ and the answer will be $$$f(l, r)$$$. (I know that's not interesting because $$$f(l, l)=$$$ $$$a_l$$$) And the output should be the array or some natural proterty of that.

      By the way nice problem.

    • »
      »
      »
      5 недель назад, # ^ |
      Rev. 2   Проголосовать: нравится -14 Проголосовать: не нравится

      Straightforward thinking leads $$$O(n \log n)$$$ (but maybe with small constant) queries, and try to cut down into $$$O(n)$$$ leads back-to-back wrong ideas.
      And splitting $$$2n$$$ into $$$n+n$$$ feels bad because asking $$$?$$$ $$$1$$$ $$$m \times i$$$ ( $$$1 \le i \le n$$$ , $$$m$$$ is a (fixed) integer) leads easily shortage of one of $$$n$$$. The actual solution is finding maximum and bruteforcing with some upperbounds, but later one costs $$$\le n$$$ queries is very unnatural I feel.

      Maybe the unnatural situation of the problem also calls my feeling.

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

        I think so too, i would say the less number of solves is partly due to the un intuitive solution and setting of the problem

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

        Why does it feel unnatural to try and split the latter $$$n$$$ into checking $$$\frac{n}{k}$$$ options that each require $$$k$$$ queries? Or did I misunderstand something?

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

          When I don't know the solution, fixed $$$k$$$ looks like shackle rather than advantage so I get lost, and I found the fact your figured almost after write my code. (Noticing after is easy but solve from $$$n/k \times k = n$$$ is hard and I feel the solution is just happened to work well or something that)

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

How to solve C?

  • »
    »
    5 недель назад, # ^ |
      Проголосовать: нравится 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

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

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

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

how problem B was solved?

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

got 180 score on A. couldn't solve anything else. bye bye pupil! :sob:sob:sob

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

my hardest div.2 till now

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

Happy to solve B, BS op!

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

can anyone explain the approach for problem-C ?

  • »
    »
    5 недель назад, # ^ |
      Проголосовать: нравится 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

»
5 недель назад, # |
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

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

    You're going in the correct direction.

    If you want a (somewhat spoiler-ish) hint:

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

Worst A ever!!! A > B

»
5 недель назад, # |
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

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

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

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

    Every time it's giving 0 as maximum, but surely it will give some positive

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

    I think that you may need to read something after you give an answer, because the interactor in this problem will return 1 or -1 after you give an answer. I also WA in pretest 1 and got confuse but after I figure it out and read one more thing after giving my answer, I passed the pretest.

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

got TLE for problem B

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

how to solve D?

  • »
    »
    5 недель назад, # ^ |
    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.

  • »
    »
    5 недель назад, # ^ |
      Проголосовать: нравится +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$$$.

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

      Damn, I figured this one out during contest but forgot to replace $$$m$$$ with $$$b \cdot mx$$$ and thought it's $$$O(n^2)$$$ queries :(

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

    you'll need to find the max, it is easy to find in $$$n-1$$$ queries (iterate over multiples of n)

    once, you've got max (call it $$$a_{max}$$$) then iterate over multiples of $$$a_{max}$$$, note that $$$m \leq a_{max} \times n$$$, candidate $$$m$$$ is a multiple of $$$a_{max}$$$

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

Problem C, I've tried some special case line n = 6 Assumpt P = {6 1 4 2 3 5} so optimal Q should be = {1 4 5 3 6 2} but not Q = {1 6 3 5 4 2}

and otherwise with P = {6 3 2 4 1 5} So i come up with solving two case but my idea seems to be wrong somehow idk. Can sb help me with this 261394519

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

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

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

Man, this was a hard contest. Took 51 minutes to solve AB.

Also, why is this wrong for C? I did the same idea as everyone else. Calculate max score for odd indices (3, 5, ..., n — 1) and for even indices (2, 4, ..., n — 2) and then take max.

»
5 недель назад, # |
  Проголосовать: нравится -17 Проголосовать: не нравится

-1e9 downvotes loading

»
5 недель назад, # |
  Проголосовать: нравится -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.

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

C is too bad

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

Finally i have reached master

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

My easy solution for A:

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

    how does it always work

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

      There can be at most $$$\frac{p1 + p2 + p3}{2}$$$ draws between 3 players. But if the total score of any two people smaller than $$$\frac{p1 + p2 + p3}{2}$$$ (for example, $$$p1 + p2 < \frac{p1 + p2 + p3}{2}$$$) then there can only be at most $$$p1 + p2$$$ draws between player 3 and (player 1 & player 2).

      I don't know how to explain it more clearly :(

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

    You can apply standart algorithm: $$$s=a+b+c$$$ and answer is $$$\left\lfloor \frac{s}{2} \right\rfloor$$$ or $$$s-c$$$ if $$$s-c\leq c$$$

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

    (p2+p3) and (p3+p1) makes no sense since the numbers are sorted (p1+p2) makes sense if C was bigger than(a+b) but how did you come up with (p1+p2+p3)/2 can you please tell ?

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

Terrible problems.

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

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

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

Terrible contest...

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

Finally I find my lucky contest lol :>

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

»
5 недель назад, # |
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

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

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

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

I don't like to guess T_T

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

Sooo fast rating updation!!!

»
5 недель назад, # |
  Проголосовать: нравится 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

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

    Bro, I got TLE on case 1. Although, running well in my pc. Don't know why!!! Finally, I have managed to get accepted.

»
5 недель назад, # |
  Проголосовать: нравится +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.

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

got skill-issued, and somehow increased rating lol

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

How to solve B?

»
5 недель назад, # |
  Проголосовать: нравится +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.

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

BUCKETPOTATO ORZ

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

I solved A in like 1hr and B in next 30 min. B without binary seach.

Why do I suck at A kind of problems.

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

That was a hard one, anyway I enjoyed it.

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

Pretest Exactly Maintest WOW!

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

Very nice round!

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

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

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

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

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

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

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

Great problems!

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

Any approach to solve this problem?I am stuck

You are given a tree of 'N' vertices, rooted at vertex '0'. You assign a random number in the range '[0, M — 1]' to each of the vertices.

Let us define 'heap-like' as the property that: for all vertices 'v' in the subtree of any vertex 'u' of the tree, the random number assigned to vertex 'u' is less than or equal to the random number assigned to vertex 'v'.

Find the probability that the resulting tree is 'heap-like'.

The answer should be found modulo 10^9 + 7. Formally, let M = 10^9 + 7. It can be shown that the answer can be expressed as an irreducible fraction p/q, where p and q are integers and q !≡ 0 (mod M). Output the integer equal to p * (q^-1) mod M. In other words, output such an integer x that 0 <= x < M and x * q ≡ p (mod M).

For Example : Let 'N' = 3, edges = [ [ '0, 1' ], [ '0, 2' ] ], 'M' = 3. Random number assignments that result in a 'heap-like' tree are [ 0, 0, 0 ], [ 0, 0, 1 ], [ 0, 1, 0 ], [ 0, 1, 1], [ 0, 0, 2 ], [ 0, 2, 0 ], [ 0, 2, 1 ], [ 0, 1, 2 ], [ 0, 2, 2 ], [ 1, 1, 1 ], [ 1, 2, 1 ], [ 1, 1, 2 ], [ 1, 2, 2 ], [ 2, 2, 2 ]. The total number of possible assignments is '27' and the '14' assignments above result in a 'heap-like' tree. Thus, the probability of a heap-like tree is '(14 / 27) % (10^9 + 7) = 185185187'.

»
4 недели назад, # |
  Проголосовать: нравится +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.

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

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

»
4 недели назад, # |
  Проголосовать: нравится +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)

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

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

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

hello guys, I have participated in code forces round 945 div2 . i have solved a and i have used some bit manipulation notes and took help of gpt i had idea but was unable to get some part of code. and i have solved c on my own. but it showed plag and skipped entire contest and rating decreased from 1359 to 1097. What to do now.