Kaey's blog

By Kaey, 4 years ago, In English

Ciao, Codeforces! We're glad to invite you to take part in Codeforces Round 701 (Div. 2), which will be held on Feb/12/2021 17:50 (Moscow time). This round will be rated for participants with rating lower than 2100.

You will be given 6 problems and 2 hours to solve them.

We would like to thank

Last but not least, we also want to thank the testers: armyalpaca, dario2994, davi_bart, DeadlyCritic, franfill, HIS_GRACE, kclee2172, lorenzoferrari, manik.jain, mattysal, namanbansal013, Osama_Alkhodairy, Prakash11, rocks03, Shusaku, simpatine, stefdasca and Retired_cherry.

The score distribution will be announced soon.

We hope you'll like the problemset!

UPD1: The score distribution is $$$500 - 1000 - 1500 - 1750 - 2500 - 3000$$$.

UPD2: For technical reasons, the round was postponed by 15 minutes. Sorry for that, good luck on round!

UPD3: Editorial is out.

UPD4: Congratulations to the winners!

Div. 1 + Div. 2:

  1. Muffinhead
  2. jiangly
  3. neal
  4. rustylake
  5. SSRS_

Div. 2:

  1. rustylake
  2. Join_VNOI_Discord
  3. Mr_Eight
  4. _Froggy_
  5. Brookli

First to solve each problem:

A: m_99
B: kmjp
C: Brookli
D: enoone
E: w0nsh
F: rainboy

  • Vote: I like it
  • +674
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
Rev. 2   Vote: I like it +101 Vote: I do not like it

As a tester, i recommend you participate in this round! Problems are very interesting and statements are well written.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +23 Vote: I do not like it

    As an Italian dish fan,I predict this round is going to be equally interesting just like thier dish

    Spoiler
    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +26 Vote: I do not like it

      Wait does that mean we'll have to write some pasta-like code?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +25 Vote: I do not like it

    I wait for the day, when some tester doesn't recommend this! xd!

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Postponed!!

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    Contest Delay 15 minutes

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +4 Vote: I do not like it

      Not meaning to be rude or aything but why did it get delayed?

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +4 Vote: I do not like it

      it says something abt maintenance till 22:00.. will it be delayed further??

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it +7 Vote: I do not like it

        Nope it is utc 22:00 so contest wont affect i guess you are confused bcoz of time zone

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

      yawn, it doesn't bother anyone in their neck of the woods. right now its dinner time in Russia, everybody's well fed and rested and setting in for the night. In other parts of the world, it's awkward timing, practically nobody is comfortable.

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

    "The Beginning is the End and the End is the Beginning"

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Well, the problems are difficult, but I like this round(because I became Expert)!

    forgive my poor English:)

»
4 years ago, # |
  Vote: I like it +15 Vote: I do not like it

I see what you did there.

»
4 years ago, # |
  Vote: I like it +70 Vote: I do not like it

lmao, poor anton!!

»
4 years ago, # |
  Vote: I like it -70 Vote: I do not like it

As a tester, I did not test.

»
4 years ago, # |
  Vote: I like it +459 Vote: I do not like it

As a person who wasn't involved in the preparation of this round, I recommend you to participate.

»
4 years ago, # |
  Vote: I like it +102 Vote: I do not like it

As a tester ,I reccomend you to read all the problems. The statements are short so you won't lose much time.

»
4 years ago, # |
  Vote: I like it -158 Vote: I do not like it

As a participant looking for negative contribution, help me to reach global minima!!!

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +61 Vote: I do not like it

    No, I don't think I will.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it -113 Vote: I do not like it

      Isn't that true with human psychology?

      • »
        »
        »
        »
        4 years ago, # ^ |
        Rev. 2   Vote: I like it -23 Vote: I do not like it

        Yes! You deserve my down vote for this :D

        P.S: He asked for down vote

        • »
          »
          »
          »
          »
          4 years ago, # ^ |
            Vote: I like it -62 Vote: I do not like it

          I request people to help him by up-voting him( given he was helping me to reach the bottom :P )

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    if i upvote, am i helping(with contribution) or obstructing you to reach global minima?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    We don't do that here

»
4 years ago, # |
Rev. 2   Vote: I like it +18 Vote: I do not like it

Many thanks to Kaey, MrBrionix, MyK_00L, taulant and TheScrasse for preparing the Div.2 contest.

»
4 years ago, # |
  Vote: I like it -18 Vote: I do not like it

As an upcoming participant. I saw newbie tester :thinking:

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    I think judging someone based on his/her ratings is a crime, it's the passion for CC that brings everyone here, even in Chess not everyone is a GM yet the people who play it enjoy it, it's high time we start judging people based on the number of contests they have appeared in, as in that case it will ultimately benefit the entire programming community.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Like the early score distribution, the gap between C and D isn't significant, makes me feel comfy! Hoping for a great round! :D

»
4 years ago, # |
Rev. 3   Vote: I like it +7 Vote: I do not like it

Stefan stefdasca Dascalescu is back to Codeforces/testing/setting yeah! I think its cause the exams are finished finally in some univerisities but not all :(

»
4 years ago, # |
  Vote: I like it +19 Vote: I do not like it

We are hopeful to have such pretests set so that many of us will not be frustrated in the final standings(In the last round it happened).Thank you.

»
4 years ago, # |
  Vote: I like it +23 Vote: I do not like it

As a participant, wish you all great rating changes :)

  • »
    »
    4 years ago, # ^ |
    Rev. 2   Vote: I like it +28 Vote: I do not like it

    Either positive or negative.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +4 Vote: I do not like it

      "Great negative rating change" doesn't make sense, I guess.

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it +10 Vote: I do not like it

        Merriam-Webster

        Great

        notably large in size : HUGE

        all creatures great and small

        • »
          »
          »
          »
          »
          4 years ago, # ^ |
            Vote: I like it -7 Vote: I do not like it

          No, I mean a "Great negative rating change" isn't a real "Great rating change" !

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

          Words can have multiple meanings. In your link, see

          4 — used as a generalized term of approval

          had a great time

          It was just great.

          • »
            »
            »
            »
            »
            »
            4 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I didn't check your profile the last time I saw your username, are you really from Finland? If yes, why the mango-lassi? Not against it but expecting a good story.

            • »
              »
              »
              »
              »
              »
              »
              4 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              It's not that great of a story. I first registered with the username "mangolassi", but lost the password (and used an old email I no longer had access to), so I made this account.

          • »
            »
            »
            »
            »
            »
            4 years ago, # ^ |
            Rev. 2   Vote: I like it +10 Vote: I do not like it

            Right. But for a phrase to make sense just one meaning needs to apply.

»
4 years ago, # |
Rev. 2   Vote: I like it +22 Vote: I do not like it

Thanks to MrBrionix, MyK_00L, taulant and TheScrasse for setting the problems Hopefully , we'll enjoy the contest

»
4 years ago, # |
  Vote: I like it +6 Vote: I do not like it

difference between c and d is 250 only. what does this represent? is it that d is not much difficult than c?

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Again early score contribution, great! thank you!

»
4 years ago, # |
  Vote: I like it +41 Vote: I do not like it

As a problemsetter, MyK_00L says that problem F is easier than C.

»
4 years ago, # |
  Vote: I like it +83 Vote: I do not like it

Has anyone noticed that all of the authors have the same profile picture?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +83 Vote: I do not like it

    Yes.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    I guess it's because that picture is the logo of the contest.(At least you can assume that)

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +42 Vote: I do not like it

      Well, not really at the beginning; I'm going to share the backstory here. At first, around 2 weeks ago, I took a picture from the Black Cherry sticker pack and set it as my profile picture on Codeforces and Telegram. A few days later, TheScrasse was looking for a profile picture to replace the Lichess horsey, and he didn't want to use a picture of himself, so I told him he could take mine. After a moment, I came up with the idea that we could all use that picture during the week of the contest.

»
4 years ago, # |
  Vote: I like it +43 Vote: I do not like it

Wow! It falls on Chinese Spring Festival. May my rating increase on the first day of the new year :)

»
4 years ago, # |
  Vote: I like it +19 Vote: I do not like it

happy lunar new year ^^, hope this contest will be a good contest ^^

»
4 years ago, # |
  Vote: I like it +16 Vote: I do not like it

i hope fair pretests !!

»
4 years ago, # |
  Vote: I like it +45 Vote: I do not like it

As a tester, I wish all the participants good luck and I recommend you all to read all the problems.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

As a to be participant, I wish everyone good luck and happy ratings :)

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

I will be posting solutions of problems of this contest tomorrow. On this YouTube Channel:- https://www.youtube.com/channel/UCfX-OxxzYPELHxpNojOojcw

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Are you sure you'll handle this?

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +25 Vote: I do not like it

      doesn't matter even he is not able to do even B but at least he contributed something and at least tried rather than discouraging others

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    Best of luck buddy, we'll look forward to it

»
4 years ago, # |
  Vote: I like it +27 Vote: I do not like it

Happy Chinese New Year!

»
4 years ago, # |
Rev. 2   Vote: I like it +22 Vote: I do not like it

Not related

Just noticed that. It makes delta 0 in unrated rounds. I think it would be better if it calculates virtual rate change like this

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

I hope this contest has strong test cases, especially pretests :)

»
4 years ago, # |
  Vote: I like it -36 Vote: I do not like it

Is it rated

»
4 years ago, # |
  Vote: I like it +7 Vote: I do not like it

The last Round was a nightmare for me (even today, I didn't understand the reason), Hoping that this time things will be much different, finger crossed.

»
4 years ago, # |
  Vote: I like it +27 Vote: I do not like it

Happy Lunar New Yearrrr

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Hopefully I will solve C today and become pupil

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

    To become pupil AB solving(I guess up to hour) is sufficient

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

      Well if B is of difficulty <= 1300 then I will do it easily I guess.But if its difficulty is >=1400 then I think it will be a challenge for me currently,Let's see what happens.Fingers crossed!!!!

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

As a tester, I wish all the participants good luck and I recommend you all to read all the problems.

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Good luck everyone, i wish we all will raise our ranks

»
4 years ago, # |
  Vote: I like it +9 Vote: I do not like it

I hope there will be a palindrome related problem to honor the day (12.02.2021) :)

»
4 years ago, # |
  Vote: I like it +30 Vote: I do not like it

It's 12/02/2021 A question on palindrome would be fun to solve .

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Happy Lunar New Year!!! :)

»
4 years ago, # |
  Vote: I like it +10 Vote: I do not like it

will the contest still be held? because Polygon and Codeforces will be possibly unavailable in the period between Feb. 12, 20:00 (UTC) and Feb. 12, 22:00 (UTC) because of maintenance.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    That would be a few hours after the contest, so it is not a problem. (the contest ends at 16:35 UTC)

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    THe maintenance won't influence this contest because the contest will end at $$$\textsf{Feb. 12, 16:35(UTC)}$$$ :)

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is today CF round has some technical issue as the message is displayed ???..

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    No, the technical issue is not related to the contest.

»
4 years ago, # |
  Vote: I like it +12 Vote: I do not like it

Authors are different but their pictures are the same:D

»
4 years ago, # |
  Vote: I like it -7 Vote: I do not like it

As a human bean, I recommend you all breathe.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

antontrygubO_o for not being involved and hence not rejecting any problem.
Is it a joke?

»
4 years ago, # |
  Vote: I like it -33 Vote: I do not like it

Why contest nowadays are not based on proper ds and algo they are mostly ad-hoc??

»
4 years ago, # |
  Vote: I like it +21 Vote: I do not like it

Delay :(

»
4 years ago, # |
  Vote: I like it -16 Vote: I do not like it

shifted by 15 min.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

This contest also starts postponing. Hoping it will not become unrated as well.

»
4 years ago, # |
  Vote: I like it +111 Vote: I do not like it

CONJECTURE : If you have exam next day and you attempt a rated round. You will screw up both ratings and grades.

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

contest postponed by 15 min

»
4 years ago, # |
  Vote: I like it +3 Vote: I do not like it

here we go again.. delay...

»
4 years ago, # |
  Vote: I like it +7 Vote: I do not like it

ok lemme listen again.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Delayed by 15!!

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Contest delayed...just hoping to not face a long queue!

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

delay of 15 min

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Has the contest been moved back?

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Now i know why they delayed the contest , They are watching LOCO CODM Cup Pro , mYm vs Godl .

»
4 years ago, # |
  Vote: I like it +258 Vote: I do not like it

Sorry for +15 minutes. I postponed the contest to be sure that everything is OK. I'm here, no reasons to worry. Good luck on the round!

»
4 years ago, # |
  Vote: I like it -6 Vote: I do not like it

Codeforces Waiting for 20,000 Participants to Cross! Agree?

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

    It is not good at all. Last time everybody shouted for the 30000 and people started coming out of nowhere. And lead to an unrated round. After that, all were disappeared, and numbers came around 20000. And now again IF you start this, IN MY OPINION people new account for such streak. which is not good.

    DownVote if don't agree.

»
4 years ago, # |
  Vote: I like it +2 Vote: I do not like it

hope it remains rated...

»
4 years ago, # |
  Vote: I like it -7 Vote: I do not like it

They should not delay the contest it is quite frustrating

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

QWQ 15 min ..

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Delayed for 15 minutes...

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

you got je'baited

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

My first contest in the new lunar year <3

»
4 years ago, # |
  Vote: I like it +15 Vote: I do not like it

Even codeforces is taking time to start the contest and you think that your crush will start loving you so easily and early! ;-)

»
4 years ago, # |
  Vote: I like it +7 Vote: I do not like it

Don't be unrated please

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

waiting for 15 min when we are all set to go, is quite frustrating but we can wait for a better experience!

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Noo!!! delay :( Wishing everything goes well :/

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

All the best 1 min remains now

»
4 years ago, # |
  Vote: I like it +2 Vote: I do not like it

My sister brought a fried chicken for me at 8:30. I said I'll eat this after 10:35.

Thanks for the delay

»
4 years ago, # |
  Vote: I like it +11 Vote: I do not like it

delayforces :) But Actually delay is better than Unrated round :)

»
4 years ago, # |
  Vote: I like it -9 Vote: I do not like it
The comment removed because of Codeforces rules violation
»
4 years ago, # |
  Vote: I like it -23 Vote: I do not like it

Please don't make contests if u can't make one.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    Bruh, don't blame the writers if you cannot solve the problems.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    I don't see any problem with the contest. It's just that it is a little tougher than usual. And it's completely okay to have such small variations.

»
4 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Welcome to the comment section, who left the contest unattempted after watching 1st question.

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

thanks for clear and short statements , really liked the problems

»
4 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Contest is running now, but I cant register now, why??

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

Wow even A was pretty tough!

»
4 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Is it rated?

»
4 years ago, # |
Rev. 2   Vote: I like it -8 Vote: I do not like it

:|

this was a hard div 2 contst

  • »
    »
    4 years ago, # ^ |
      Vote: I like it -29 Vote: I do not like it

    It's not a shit contest, but it is made for div1 after b.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    Though I couldn't do my best today, I think the problem-set was pretty standard. Being unable to solve a problem doesn't mean it has to be a shitty contest.

    Besides, you don't have any right to insult a setter panel like this. I enjoyed the problem-set. And I am pretty sure they worked really hard to make this contest enjoyable and successful.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

20,000+ Registration and somewhat 10,000 people made submissions :/

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve C,D ??
Verry toough contest for mee :(

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

    Hint : We can find all pairs $$$(a,b)$$$ by fixing remainder $$$R$$$. $$$R$$$ must be less than $$$sqrt(x)$$$ and we can do binary search .

    Full Idea
  • »
    »
    4 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Problem D:

    LCM of all numbers from 1 to 16 is 720270. You can fill a matrix B with this number. Now all we have to do is to make differences of k^4. For that you can simply subtract A[i][j]^4 from B[i][j] in a chess pattern. Now all numbers in B are divisible with the numbers in A and they respect the conditions.

    Here is my code: 107219536

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

    For C, for one possible b, min(b-1,floor(x/(b+1))) values of a is possible I did it by breaking it in two parts doing first for b which are less than sqrt(x) and then the for the b whose multiples are less than sqrt(x). The numbers left need to be tackled separately so that any b is not counted more than once. Solution

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

lol that F was nice XD

»
4 years ago, # |
  Vote: I like it +3 Vote: I do not like it

How to solve C ? Plz

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i use a = c * (b + 1) then c = 1...5e5 (c < b) for each c find how many b and a satisfy

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    a should be of the form n*k+k. Now n*k+k<=x, then n<=(x-k)/k. Now iterate over k from 1 to x (say). answer will be incremented by min(n,y)-k, I did this because numbers which have k as the remainder and quotient will be in between k+1 and min(n,y). Now if min(n,y) < k+1, then you should break the loop because right value is smaller than left value. You can check using simple maths that you don't need to iterate for k more than sqrt(x+1) times check to get the final answer

»
4 years ago, # |
  Vote: I like it +5 Vote: I do not like it

I like this type of contest :) Thanks for good problems.

»
4 years ago, # |
  Vote: I like it +6 Vote: I do not like it

How to do C or D ?

»
4 years ago, # |
  Vote: I like it -11 Vote: I do not like it

Very bad contest!

»
4 years ago, # |
  Vote: I like it +60 Vote: I do not like it

Unbalanced contest.

Today we had a Mathforces ! Problem C was too math oriented.

C should have been divided in two parts, with lessor and higher constraints.

I got the idea of C but couldn't implement in 1.5 hours :(

Approach
  • »
    »
    4 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I noticed a pattern in C:

    a : b : cnt

    3 : 2 : 1 <3>

    4 : 3 : 2 <4,8>

    5 : 4 : 3 <5,10,15>

    6 : 5 : 4 <6,12,18,24>

    so suppose take set for a=6 then every number in that set and b is special pair.

    .....

    a goes till x and b till y. Take approproiate minimas of x and y though.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I'm not sure if your approach would fit in the constraints as x,y <= 1e9.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Hi, actually I had a very cool idea. But its a little bit maths oriented :(
    Approach : a should be of the form n*k+k. Now n*k+k<=x, then n<=(x-k)/k. Now iterate over k from 1 to x (say). answer will be incremented by min(n,y)-k, I did this because numbers which have k as the remainder and quotient will be in between k+1 and min(n,y). Now if min(n,y) < k+1, then you should break the loop because right value is smaller than left value. You can check using simple maths that you don't need to iterate for k more than sqrt(x+1) times check to get the final answer

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    C could be done with binary search too

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

Unfortunately, I have seen a similar task with C when preparing for our last round...

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

Is C is really something so simple, or it is easy to google? :)

Because all I have thought is to try solve $$$a = (b + 1)ceil(a / b)$$$ and it led me to "iterate $$$b$$$ over $$$[1; y]$$$ and add to answer $$$min(x, b(b+1) - 1) / (b + 1)$$$". But ofc it's $$$O(y)$$$ :(

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

    I literally submitted that: https://mirror.codeforces.com/contest/1485/submission/107226790

    (and it TLEd obviously)

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

    it's not o(y) because you only have to go until min(y,1e5).

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +4 Vote: I do not like it

      I don't know how to calculate sum of $$$x / (b + 1)$$$ in range $$$[sqrt(y); y]$$$. I think there is formula but not found it.

      • »
        »
        »
        »
        4 years ago, # ^ |
        Rev. 3   Vote: I like it 0 Vote: I do not like it

        After you pass sqrt(X), some values start to repeat (ie. floor(100/80) = floor(100/81) = 1)

        You can split the code into two parts, one iterate from [1, sqrt(X)], doing the same thing you made:

        • ans += X / (b + 1).

        For the rest, you could iterate on the quotient, instead of the divisor (ie. how many Z satisfy 100 / Z = 1?)

        It will end up as a pattern like this:

        • for every i in [L, R], floor(X / i) == 1
        • for every i in [R + 1, ...], floor(X / i) == 2
        • ...
        • for every i in [..., ...], floor(X / i) == sqrt(X)

        So you will end up with another loop that iterate over sqrt(X) values, doing this operation:

        • ans += (R — L + 1) * quotient
        • »
          »
          »
          »
          »
          4 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Yeah, I've already done that 107235694

          Silly me that not thought of it during contest

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Great Round, thanks.

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

How to calculate Summation min(b-1 , x/(b+1) ) in C . b varies from 1 to y . Is there any other way??

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

    No need to go till Y. Iterate on the remainder, the maximum remainder you require is 32000.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Observe that $$$min$$$ is only useful for $$$1 <= b <= sqrt(x)$$$.

    $$$sqrt(x)$$$ isn't that high. So you can bruteforce the part with $$$min$$$.

    For other values of $$$b$$$, just do a binary search on when $$$x/(b+1)$$$ changes. As there are around $$$sqrt(x)$$$ different such values (remember harmonic sum?) this would not be that bad either.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I kind of observed that , but thought it's C and shouldnt be that trickier. Knew that n/x yields same value for i <=x<= n/(n/i).

»
4 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Was there some trick in D?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    Yes. 720720 is lcm of numbers from 1 to 16, i.e. 720720 is divisible by any number in our matrix. further if (i + j)% 2 == 0 b [i] [j] = 720720 else b [i] [j] = 720720 + a [i] [j] * a [i] [j] * a [ i] [j] * a [i] [j]. chess coloring

»
4 years ago, # |
  Vote: I like it +24 Vote: I do not like it

fuucccckkkk, I couldn't submit E because I spent the last 10 minutes debugging the fact that my ape mind didn't understand the tree input format

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    That tree input sucks.

    It should be trivial to implement the parser.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It's actually my favorite way to input a tree. You can show that v[i] is also the parent of i, which saves you from doing a dfs to separate parent and child.

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

Kudos to problem setters. Short & crisp problem statements were great!!

»
4 years ago, # |
  Vote: I like it +17 Vote: I do not like it

Whoa, that was tough but fun.

A was a bit tougher than usual but OK. I felt B and C required really careful implementation (especially C). I solved as far as C and I can tell by the rankings that this contest was tougher than usual.

Couldn't crack D, was interesting though.

»
4 years ago, # |
  Vote: I like it +34 Vote: I do not like it

Again, I realized how bad my math is :(

»
4 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

I think problem F is easier and lighter(implementation wise) than usual. Otherwise, A pretty nice round. Thanks for the problems.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

it sucks so bad when you realize how D can be solved after coding a dumb ass recursive solution and there is only 1 minute left.

»
4 years ago, # |
Rev. 4   Vote: I like it +26 Vote: I do not like it

For D. Notice that minimum number that divide each element is $$$720720$$$. We should make difference between adjacent elements equal $$$k^4$$$ for some $$$k$$$. Consider our matrix ass chess desk with white and black cells, so each white cell will be adjacent to black cells and vice versa. So we can set black cells equal $$$720720$$$, and white $$$720720 + M[i][j]^4$$$ what is less than $$$10^6$$$ and difference condition is met.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

for $$$C$$$ the answer will be $$$\sum_{b=2}^{Y} min(X/(b+1),b-1)$$$. Can anyone tell how to compute this efficiently?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This is what I did: up until b=1e5 just apply the formula you mentioned, and after that it is clear that $$$X/(b+1)$$$ will be the minimum for whatever value of X, so figure out a way to efficiently do $$$\sum_{b=1e5+1}^{Y} X/(b+1)$$$

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

107225945 why my code getting tle ? explain me!

»
4 years ago, # |
  Vote: I like it +9 Vote: I do not like it

I corrected a mistake in my solution for E just two minutes after the contest was over, and then it passed the sample test case. I met such a situation again and again. o(╥﹏╥)o

Anyway, I'll try my best next time and wish myself to keep calm during the contest for better debugging.

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Please Help Suppose I submit a correct solution of a problem and a minute later i again resubmit another correct solution of the same problem . Will the second solution get a penalty of 50 points because that is what happened with me today in problem A despite never having a wrong submission . Instead of 478 points I got 428

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

    Yes, it does happen that way. Even if your original submission happens to be correct, (which is not something that is known during contest as only pretests are run) you still incur a penalty.

    If I am not wrong, the only submissions that don't count towards penalties are

    1. the first submission (not counting any compilation issues beforehand)

    2. Submissions that fail to compile.

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

Unfortunately, weak pretests for B.

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

    wrong answer 80200th numbers differ — expected: '930343232', found: '576709456628597052'

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I got FST on B for a very simple case which is when l==r, this type of simple cases should be present in the pretests.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I also got FST on B I forgot the case for n=1 , today I had the chance to become expert but I missed it :(

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

if i have 2 more min, i would AC B :(

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Thanks for the great problems. What is the fastest way of finding any positive solution to $$$ax + by = c$$$?

»
4 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

My bad.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It's too late to hack in contest, but CM's and above can uphack, which would add the test for future upsolvers. It won't change anyone's rank in contest, but it's still useful (not to mention fun). If you send me the submissions and the hack test, I could uphack them for you.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    test case 26 has n = 1.

    so no, not a "lotta solutions" fail to cover n = 1.

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

like task D

»
4 years ago, # |
  Vote: I like it +9 Vote: I do not like it

Dear Kaey, I am very sorry that I complained irrationally about math today. I may have hurt your feelings unintentionally. I may have disrespected your hard work. I didn't want to do that. I loved today's problem set. I deeply appreciate your hard work. As I suck at math and I didn't have anything to do, I irrationally started trolling you guys without thinking a bit. But one of my friends made me realize that I was very wrong. I am extremely sorry. Please accept my apology. I hope to see you guys set more awesome contests like this! Thank you.

»
4 years ago, # |
  Vote: I like it +14 Vote: I do not like it

Easy D (1750), LOL

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +14 Vote: I do not like it

    D feels like aprils fooling if not solved :/

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Just chess coloring of 720720 and same number minus a[i][j]

»
4 years ago, # |
  Vote: I like it +6 Vote: I do not like it

oughh... Pleeassee make pretests hard :'( it hurts so much

»
4 years ago, # |
  Vote: I like it +64 Vote: I do not like it

$$$\lfloor \frac{a}{b}\rfloor$$$ forces

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Nice contest..... I like that there are hints in editorial before giving out the solution

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Don't know about others, but coming from a math background, this contest was really enjoyable. Kudos to all the authors! :)

»
4 years ago, # |
  Vote: I like it +18 Vote: I do not like it

A-D are math problems

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone tell why B failed on System Test 5?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Check when b is equal to 1, e.g.

    4 1 10
    6 7 8 9
    1 1
    
    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Can't believe I missed this case. Anyways thanks a ton for help!

»
4 years ago, # |
  Vote: I like it +8 Vote: I do not like it

Thanks for good pretests in B...

»
4 years ago, # |
Rev. 2   Vote: I like it +21 Vote: I do not like it

if I read D before C, I would AC D :( Why in this contest D is much easier than C?

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Thanks for the contest :)

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I tried to calculate $$$Dp_i$$$ from bottom to top in problem E, but got wa on test 3. It works like this:

sort(stage[i].begin(),stage[i].end(),cmp);
ll Max=-Inf;
rep(j,0,stage[i].size()-1){
    int k=stage[i][j];
    f[fa[k]]=max(f[k]-a[k]+maxx,f[k]+a[k]-minn);
    f[fa[k]]=max(f[fa[k]],a[k]+Max);
    Max=max(Max,f[k]-a[k]);
}
Max=-Inf;
per(j,stage[i].size()-1,0){
    int k=stage[i][j];
    f[fa[k]]=max(f[fa[k]],Max-a[k]);
    Max=max(Max,f[k]+a[k]);
}

Where $$$i$$$ is the depth. The nodes in $$$stage[i]$$$ has the same $$$dis$$$ which is $$$i$$$.

$$$minn$$$ is the minimum of $$$a_i$$$ at the same stage, $$$maxx$$$ is similar to $$$minn$$$.

Could anyone explain that why it is wrong? The submission : 107250435

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Hello everyone, this is my first time making a tutorial if you like then please like and share and if there is any concern then please comment: https://youtu.be/fMZIuQU7fqY Solutions for problem A,B,C,D

»
4 years ago, # |
  Vote: I like it -23 Vote: I do not like it

Why have the recent rounds started adding so many Adhoc, Math and Constructive questions? We should have more DP, Graph, Range Queries etc.

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

A very cool problemset. Thanks.