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

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

Hello, Codeforces!

I'm very glad to invite you to Codeforces Round 658 (Div. 1) and Codeforces Round 658 (Div. 2). This contest will take place on 21.07.2020 17:35 (Московское время). In both divisions, you will have 2 hours to solve 5 problems (and one subtask). The score distribution will be announced closer to the start of the round.

Huge thanks to:

I've worked hard to ensure the pretests are short and the statements are strong. Remember to only read the problems that you can solve, and may you have the best of luck!

Because I know you all have so many questions, I have compiled an FAQueue

  • Q: Is it rated?
  • A: Yes

UPD Here is the score distribution:

Div. 2: 500 — 1250 — (1000 + 1000) — 2250 — 3000

Div. 1: (500 + 500) — 1500 — 2000 — 2500 — 3000

UPD Editorial

UPD I filled in the answer to the FAQ. Also, congrats to the winners!

Div. 2:

  1. badger_champion

  2. Mai_madarchod_hu

  3. rulai

  4. Vimmer

  5. niynip

Div. 1:

  1. Benq

  2. Um_nik

  3. KAN

  4. Petr

  5. ksun48

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

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

As a tester, give Monogon contribution.

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

As a tester, contest is bullshit.

Reference: https://codeforces.com/blog/entry/76777?#comment-613713

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

As a tester, I recommend reading FAQueue

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

So many questions and so few answers...

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

(and one subtask)

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

Hope we don't encounter statements like Unrated and ruined, Upset and demotivated from mike.

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

Please use original FAQueue . Don't change.

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

    So this dude's pc is filled with screenshots I guess

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

        Is this picture even relevant as reply to my statement or you just used it to prove that we are too dumb to understand xD

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

        Its like Div2 F for me, can you please explain this image

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

        "Ending racism by going vegan"

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

          False.

          Spoiler
          A picture is worth a thousand words
»
4 года назад, # |
  Проголосовать: нравится -53 Проголосовать: не нравится

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

When you realize that Pretests are short and Statements are strong. ;-;
![ ](dd0)

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

Gonna be an amazing contest.

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

Remember to only read the problems that you can solve New thing in the announcement

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

Hope to get some relief after the deadly Div2 round #657.

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

Meanwhile

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

As a participant, I can ensure that good coders will have increased rating at my rating's expense. ;)

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

did I read it right?

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

Why not this? (it's more accurate tbh)

Huge thanks to DeadlyCritic for being useless, and doing nothing, and not helping with problem in any kind.

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

Where's the Monogon Platform?

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

As a tester, this contest is unrated (for me).

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

As an astrologist, I predict long queues again. XD

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

getting a hunch that this one is going to be one hell of a ride or maybe 567 is still haunting me who knows

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

    I think the previous round got into your head just too much that you can't even remember the Round number correctly!!
    #Round 657

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

Older guys, please tell me if Mike Mirzayanov cares about mentions in comments

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

"Remember to only read the problems that you can solve"

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

Isn't it true Monogon ?

I-Do-One-Push-Up-Meme-Template

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

Such a great FAQ!!!

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

zeoob.com_6boo0qgal9_photo.png

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

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

Finally, Monogon is back!

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

Hello, I got quetion, in the problem D the test case include el case asdfghjk and the answer is 7, but the answer but the answer shouldn't be 6?. The string of the answer would be ddddgfee

sorry, ignore me, I was wrong about competition blog

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

Codeforces is very good!There are three to four competitions a week!

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

what does a short pretest mean? Less tests or just easier pretests? edit: sorry if im misinterpreting something or if theres some nuance but it would be really helpful if someone could answer instead of just downvoting

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

    "short pretests and strong statements" is a joke, it should have been "strong pretests and short statements"

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

I've worked hard to ensure the statements are strong

Don't tell me it's 2 hours of thinking for 4 lines of code..

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

all they are attempting to do is demotivate contestants and cause fewer people to participate

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

[Deleted]

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

I'm very sorry to say but this round is going to be unrated

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

This month is already a disaster(in terms of our heartbreak during contests). I hope this contest will conduct smoothly. All I want to not see that popup message from mike! Let's hope for the best

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

Wow, Monogon is this you?

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

Great contest

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

What is mean by one subtask?

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

constructiveforces!!!

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

Hope to become a master after this round.

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

Reading the blog, this looks to me a very different contest than usual. Really excited for this one!

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

Monogon how many shared problems will be?

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

do you guys know when will they announce the answer of this (Q Is it rated?). If announced can you leave the link below? If it's not rated I would rather virtual this round because in my time zone it's late night. Thanks!

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

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

What does it mean by (1000+1000) in score distribution of div2?

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

I'm new to cf, but why do they tell you do only read problems you can solve?

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

    Because if you know you can't solve them, why waste the website's precious resources by requesting for the problem page?

    It's codeforces new strategy to reduce server load.

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

    They meant "only solve the problems you can read".

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

After seeing score distribution

Good luck with question B.

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

I'm not strong enough to compete with all of you >_<

I need do more problems, luck for you!

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

In div2, D is worth 12% more than C (that's 2250 vs 2000 points). In div1, those two problems differ by 50% (1000 vs 1500 points). Maybe these two fractions shouldn't be equal but should they differ that much? I don't think so.

#geometricprogressionmatters

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

    well in div2 people usually solve problems in order a b c d etc . and it takes time to solve c1 and c2 and that time is gonna be counted for both of the problems . (penalty would be too much for c1+c2) i think its the reason .

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

      You ignored the fact that penalty is in proportion with the problem points.

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

awaiting a good round

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

Hope,It will be a great round and we all get high rating, in shaa allah.

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

so your compiler of FAQ didn't show any output !

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

System test would be a disaster today. Why?

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

For no reason I hate subtasks. :/

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

Remember : Only read the problems that you can solve. If you can't solve it, don't read it in the first place.

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

    Interestingly, all 4 of these are helpful advice:

    • Remember to only read the problems that you can solve (waste of time)
    • Remember to only read the problems that you can read (waste of time)
    • Remember to only solve the problems that you can solve (waste of time)
    • Remember to only solve the problems that you can read (you won't solve it anyway)
»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Problem page for me keeps loading.. It's showing nothing

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

Problems are great, I wish the queues don't get really long this time.

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

I had a correct answer to C1 and I resubmitted by mistake because I had both C1 and C2 open and I was trying to submit to C2 the improved solution. This cost me 200 points :(((

( I submitted C1 after 30 minutes and the second one was after an hour)

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

    Same with me. Isn't only the first accepted submission supposed to count? Or have the rules changed? :(

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

      But pretests passed does not mean it will always pass system testing. The initial solution may not be totally correct so one might want to resubmit a better solution that also passes pretests, but would also pass system testing.

      In addition, haven't the rules always meant that resubmission costs 50 points no matter what?

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

        Well it would be nice if you could choose (the default is the last one, but you can choose a previous revision).

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

    In D won't the answer of last test case be YES?

    If we take A-[4 3 2 5 1 11] and B-[9 12 8 6 10 7] .

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

      No, because 11 and 9 have to be in the same array. The big observation is that if there is a maximum up to now (which 11 is), then until you pass that max, all of the following elements must be in the same array as the max. That's because if they are smaller, and they were in the other array, they would have been picked before the max.

      Think about your example. after 4 3 2 5 1 where chosen, there could be two scnarios:

      a = 11 ...

      b = 9 ...

      or:

      a = 11 9 ...

      b = ....

      The first case CAN'T happen, because 11 was picked, so 9 has to be in the same array with 11.

      My solution simply groups together elements that have to be in the same array, and then I create an array of the number of elements that have to be grouped together. in the last test case, the list of elements is [{4,3,2}, {5,1}, {11,9}, {12,8,6,10,7}] which turns into [3,2,2,5] Now each of these groups can be assigned to any array, so you need to find a subset of elements who's sum is equal to n, which is the subset sum problem. Then I copied this dp solution: https://www.geeksforgeeks.org/subset-sum-problem-dp-25/

      And all you have to do is use this function and return "Yes" if True or else "NO". My solution:

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

Hmmpfffh! Totally disappointed by the explanation of Problem C. It's been 20 minutes and still not able to understand it fully.

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

    What part of it do you not understand? In one operation you take some prefix, flip the bits and reverse it. Then you want to turn string a into string b in 3n operations (or 2n, for the second subtask).

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

      It wasn't clearly mentioned that we'd to reverse and then flip the bits (doing vice versa would yield different results!). Overall, it was a confusing statement but a nice question.

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

        Can you give an example of a string such that reversing the bits and then flipping them produces a different string than flipping and then reversing them?

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

I have submitted code B twice. Then I realize the first code was not wrong. Is there any way to cancel the last submission? My rating has changed a lot because of the last submission.

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

Nice problemset! Really enjoyed the contest! :)

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

    In D won't the answer of last test case be YES?

    If we take A-[4 3 2 5 1 11] and B-[9 12 8 6 10 7] .

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

      It would give 4 3 2 5 1 9 11 12 8 6 10 7. Which is different from the last test case. Also, don't leave your comment under other's comment.

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

      merge(a,b)= [4,3,2,5,1,9,11,12,8,6,10,7] not [...11,9...]

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

My Video solution for Problem B. Hope you Like It.

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

Am I the only one who solved Div1A2 using Treap?

Solution: smash me

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

😩😩😩😩
please make contests harder, this one wasn't fun

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

    previous one was pretty hard :p

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

    Speaking for div1, lots of contestants only manage to solve A or A+B, and the competition boils down to solving these 2 faster (=typingforces) — and the scoring distribution among the second half of participants doesn't reflect their skills. Harder contests will make this even more problematic.

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

      oh i forgot to look at the standings and realize C wasn't easy

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

        Out of curiosity, is C the type of problem you have been advocating for? It seemed to be a pretty good example of easy solution, nontrivial implementation (assuming my solution is correct).

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

    how did you manage to get WA on A1 and AC on A2?

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

How to solve C2? Was it based on a similar technique as C1 with optimization, or an entirely new way?

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

    Instead of reversing string i access string form back and front(using deque). Everytime making a character equal i remove that from a and b. And i handle flip of bit using equal and not equal.

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

    Use two pointers

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

Please, someone, help me with C2. Thanks in advance

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

    make a either all 0 or all 1 than solve it from the last index

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

      Yaa that I get but what about reversing string in each step??

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

      this is much better what I was doing was adjusting the first index of a according to the b[i] and then reversing. before checking the value of a[i] I was just adjusting its value. I saw the patter to how I should adjust value just before 2 minutes at the end :(

      I missed div2 C2 by 10 sec. I am pissed i am always careless.

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

      how do you make everything 0 or 1?

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

        let say we r at index i from i-i-1 a is either 0 or 1 so if i is same then we have to nothing otherwise change 0-i-1 values

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

    i did it using two pointers and flag that shows the fact that s[l,r] has been reversed

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

Any hints for D?

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

Is the required and sufficient place where a snake can flip around a vertex $$$v$$$ connected to 3 disjoint paths with length >= snake length? I assumed so and looked for all such vertices $$$v$$$ which the snake can reach with its head/tail, but got WA, so I'm wondering if I have a bug or the idea is wrong.

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

now after problem C1, I won't forget that "STRING IS IMMUTABLE"

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

D1D was inspired by task from MIPT workshow (2019 day 5 B Little Worm). Both are extremely shit.

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

    ... which is taken from Polish ICPC stage (AMMPPZ in Cracow). I was one of the organizers of that contest and I was too lazy today to search for the solution code — solving other problems seemed more fun.

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

      I've wasted a lot of time trying to use these codes — I think that it's hard to use them as the problem was slightly different.

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

        I've used the code for the Little Worm problem to check if we can reach a diameter. It's a bit easier to solve it if our snake is already located on a diameter.

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

      Well, code from that problem didn't help me much, although some parts of the solution share the same idea.

      Also, I liked both problems and I don't think they are too similar: in older problem, the start and finish positions were disjoint as paths, in today's problem they coincide. I hope I will not see the problem without position restrictions in a contest, though :)

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

How to solve C1 with 3*n operations?

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

    change elements of a from the end one by one

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

    solve from the last index if it is correct than just remove it from a if it is not make it correct with the help of 1 index

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

    I got pretests passed both subtasks with a simple greedy algorithm:

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

    You can always use the zeroth index character for swapping. Iterate from back of first string if its different , then check for conditions.In case — the first character of first string is different from character of second string , you can just perform operation once and update the string : else you need to perform the operation two times first on the very first character of first string which makes it different from character you wanna change for in second string and then perform operation on prefix of first string of desired length.

    Ps: sorry for bad english!

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

need a quick editorial now

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

Div2A, Div1B, Div1C, Div1D — Codeforces? More like YesOrNoForces

(I'm actually mocking people that complain about the lack of diversity in problemset by checking similarities that are not relevant).

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

C2 is very interesting. Do we need any data structure to proceed operations?

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

in C-2 has anyone thought of doubly LinkedList kind of thing with a status variable?

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

Do anyone know how to bitset in dynamic length?

Please help. I think I got TLE on pretest 3 in C2 coz of inefficient implementation of this :/

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

Anybody else wondering why problem B have more points than C1 ?

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

Is it rated? :)

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

The sample test case explanation was enough for solving Div2-B.. but I didn't care to read it at first because I thought NIM was always based on XOR.. nvm got AC after reading it.

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

    whats your approach and what you conclude from test case?

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

      "The second player should take the stones from the second pile because the first pile is empty. He will take 1 stone because he can't take any other number of stones."

      The first player can always force ze second player to take out any desired no of stones(which shall benefit him) in every turn , unless he is forced in the same way if there's only 1 stone to take out in the start.

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

As expected nice problemset. Next time i will like to solve problem named Monogon and rescheduling.

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

In D won't the answer of last test case be YES?

If we take A-[4 3 2 5 1 11] and B-[9 12 8 6 10 7] .

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

    No, if you merge these 2, you will get

    [4, 3, 2, 5, 1, 9, 11, 12, 8, 6, 10, 7] which clearly not equal.

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

Last div2 was like div1 and this div2 was like div3. :-)

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

    -1+1=0. "Perfectly balanced as all things should be"

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

      Some things can't be assume to be balanced like "blood pressure" if for half of the time it is above than normal and other half of time it is below normal then you can't call a patient as normal. I think same goes for difficulties in contest.

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

Video Solution to C1 and C2.
I have discussed how to solve in 2n operations and N^2 time, how to solve in 3n operations and O(N) time.
Finally optimized 2n operations and N^2 time to 2n operations and O(N) time.
Enjoy watching: https://youtu.be/TSr0x3EBWSg

I will most likely make for D also :)

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

Am I only the who who get WA in problem A on test 5(System tests). It's strange. UPD 87526239

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

It's good to see a geometry problem from time to time, even if it's nothing new and groundbreaking :D

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

    It's good to see Errichto in comments from time to time, even if it's.. wait what.. no..

    Instead I want to see you on contests page hosting one. :D

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

    It's good to see you in comments from time to time even if it's just for the purpose of gathering some upvotes and increasing your overall contribution through random rheoteric comments.

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

    It's good to see you solving geometry problems so easily, even when most of the people find them really hard.

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

I think the time limit of Div.2 D is too tight. I got the right solution when it was only 30 second before finish, but get TLE disappointedly. My TLE Code

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

From many past contest, counting this one I am having a syndrome that I call "Coded Bug Free Solution after 10 mins of contest is over."
Any helpful tips to get the job done without bugs within time limit??

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

    Every time you find a bug, answer 2 questions:

    • Why did this bug appear
    • How do I change my coding practices so that a bug like that will never appear again.
    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      That's a good idea. I think I should maintain a journal about it.
      Thank you for your advice!

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

    I think instead of trying to code without bugs, learn how to debug.

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

      What if I learn both to code without bug(Amortized analysis!) and also to debug.

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

How to solve Div2E?

I used DP on state (i, j, s) which means merge(a[1:i], b[1:j]) (the variable s is used to determine the (i+j)-th element of p belong to a or b)

Let x be the nearest index such that x > i+j and p[x] > p[i+j].

Then the transition is to try to append the x-th element to a or b.

I'm not sure about my solution (although pretests passed). Does anyone have another idea? ^_^

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

I think I may finally hit purple thanks to your contest :) So thank you!

I had to think hard the entire time. I especially enjoyed Div2 D. Not sure if it was the intended solution, but I ended up doing a subset sum problem on sizes of segments in the array, after realizing that the array could be split up into segments in a natural way.

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

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

Nice round imo. I think that for a long time there was no geometry and it's generally nice when problems touch various topics and ad-hocs aren't in majority. Kudos

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

(I already posted it but it was deep in a thread so probably people won't notice it)

An elegant solution that probably works for problem D (finished it 10 seconds after contest was over so not sure :| ): EDIT: Well, it TLEs on test case 30, probably just because of python :|).

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

Interesting observation: when you get WA on pretest 1 on problem C (div1), if you click on your submission, checker tells you what's wrong with your output and provides some additional information (in this case, for example, that in the test case 2, x is not what it should be). You also don't get any penalty for WA1.

This is kinda non-obvious, and gives some slight advantage to people who decide to check the details of the submission. Maybe we shouldn't print stuff like that in a checker?

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

    Printing helpful information in the checker has always been preferred. But I believe it's not available during the contest, and you only see the verdict itself.

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

      No, I actually saw the exact same thing during the contest too, and used it to debug my solution in the last minutes. In was definitely easier than understanding what's wrong myself.

      I agree that printing stuff in the checker is helpful, maybe CF shouldn't show checker output to the participants then.

      Anyways, thanks for the round, I liked the problems! (even though I wrote a silly N^2logN solution with N Fenwick trees on B :)

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

        Why not show the output? This is the sample, so participants could very easily run their program against the case and figure out what is wrong (except if maybe they misunderstood some part of the problem, in which case it is very much in the spirit of samples to give some help as to where the issue is).

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

          Well, you never really know what checker will say (just "answer is not correct", or "answer is not correct because of X"). To find out you need to get WA1 and check out the submission page, which is not obvious, and may give advantage to people who happen to do so.

          And output in the style of "answer is not correct because of X" can be very helpful when you are constructing the answer, and using sample 1 to see if your construction is correct.

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

      It gives additional information on contest time too. Today i got it on D2C1.

      And i have seen this few more times before. Sometimes it helps to verify if i understand problem in wrong way.

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

Very bad pretests in A2. Why didn't you add the max pretest? I thought that if the solution passes pretests in terms of perf, it would be accepted.

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

Mai_madarchod_hu is in 2nd position of today's round. I am just imagining the post with the winner's list XD

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

I have a rating of 1282(Pupil). Just wanted to ask if Round 658Div2 will be rated for me and will it affect my graph, as it is not updated as of now. I'm new here, please let me know. Thanks

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

I wish the contests would have been 2:15. Then I would have got D

:((((

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

Hello, Monogon

I think the main test data for div2D is weak.

Check this 87590140 for example.

Input:

1
9
2 1 4 3 7 6 5 10 9 8 13 12 11 18 17 16 15 14

The answer should be YES, but this submission provides NO. Please have a look into it.

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

    I'm sorry that the tests seem to be weak. The final standings are already out, but I can add test cases like this to the system tests so that more wrong submissions can fail in practice mode.

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

      Monogon Please add this test case as well. It seems to give NO as the output for some codes (including the one mentioned above) whereas the answer should be YES.

      Input:
      1
      16
      27 1 28 2 29 3 4 5 6 7 30 8 9 10 11 12 13 31 14 15 16 17 18 19 32 20 21 22 23 24 25 26

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

Thanks for the round!

My screencast: https://youtu.be/VaCa0CQpYbo

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

Monogon, Thanks for the contest! I liked it :)

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

This was my fifth contest and I liked it. I could have solved the unmerge problem. Ran out of time. Need to get quicker

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

The first time I solved a D and got Pretest passed, they failed system test and got TLE.....
Maybe the pretests were infact short :P

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

Maybe only me can't find the operations that transform the string a into b in more than 2n steps...I think 1A1(2C1) is a little strange.Because if we fix the bits one-by-one,it's so easy to find a 2n steps in O(n) time.But the contest is nice and thank for +77 lol

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

    There were some random solutions people used, several 3*n solutions worst case, and a couple 2*n solutions that weren't optimized to n^2 in testing. Monogon posted some of them in the editorial if you're curious.

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

qwq.png

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

Does anyone have any idea behind the reason for rolling back the ratings?
Did I miss something?

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

    It usually happens when some cheaters are caught, causing the rankings to be re-judged.

    I think the same must have happened this time too.

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

      Could this be the reason?

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

        Yeah, but Monogon clearly states that he will amend test cases for the practice mode, I don't think that it would affect the contest's ratings rollback

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

In D2C2, I tried implementing the solution 1 of editorial and it works fine on my system. However, it is giving Runtime Error on submitting. I've tried debugging but to no avail. Can someone help find the mistake(s)? My solution: https://codeforces.com/contest/1382/submission/87742162

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