Imakf's blog

By Imakf, history, 2 months ago, In English

Hello, Codeforces!

Daniel_yuan, waaitg, smg23333 and I are glad to invite you to Codeforces Round #706 (Div. 1) and Codeforces Round #706 (Div. 2), which will take place on Mar/10/2021 15:05 (Moscow time). Note the unusual time of the round. In both divisions, you will be given 6 problems and 2 hours to solve them all.

We would like to thank:

Score distribution will be announced before the round.

Hope you all gain positive ratings $$$\Delta$$$ in this round!

UPD1: Score distribution is

Div. 2: $$$500-1000-1500-2000-2500-3000$$$

Div. 1: $$$500-1000-1500-2000-2500-3250$$$

UPD2: Editorial

UPD3: Congratulations to the winners:

Div 1:

  1. Radewoosh
  2. maroonrk
  3. tourist
  4. Um_nik
  5. Egor

Div 2:

  1. shikaichengwoerzi
  2. grey
  3. 2005lz
  4. sh_mug
  5. not_tehlka
 
 
 
 
  • Vote: I like it
  • +580
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it +408 Vote: I do not like it

As a problem setter, I set some problems.

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

    As a problem setter, I set some problems.

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

      Tao God, eternal God! fkami, my superhero!

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

      As a tester, the statements are short and pretests are strong and give me contribution.

      • »
        »
        »
        »
        2 months ago, # ^ |
        Rev. 2   Vote: I like it +48 Vote: I do not like it

        As a contestant, I will take back my up-vote, if the tests turn out to be weak.

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

          You can't do that.

          • »
            »
            »
            »
            »
            »
            2 months ago, # ^ |
              Vote: I like it -37 Vote: I do not like it

            I can,by down-voting from an alt account.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        how does one become tester?

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

        As a contestant, this claim was incorrect.

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

        pretests are strong!

        codeforces × FSTForces √ :(

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

      I love this round and wish I could participate in this nice round (but sadly as a tester I can't, but can I get some contribution?) XD

      Good Luck!

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 3   Vote: I like it -9 Vote: I do not like it

       It was good

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

    As a problem setter, I want some contribution, too. XD

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

    "In the upcoming round, you can use only Kotlin." is this notification for this round?

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

      Apparently no. That's the notification for Kotlin Heroes: Episode 6. This round is a normal Codeforces round in which C++, Java, Python, etc. can be used.

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

    As a contestant, I will solve some problems. :-)

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

      As a contestant, I will try to solve more problems than create?..

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

        Sure.. you can but for this, you have to solve problem sets for past contests. :)

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

          I just meant I don't want to be additional problem for the contest creators :D

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it -13 Vote: I do not like it

      As a contestant, i will try to solve all problems:)

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

    Okay, I am a bit serious now, how to be a tester and what are the perks of being a tester ?

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

    It is NOT funny anymore, stop repeating this stupid flat joke 100th time in a row after every announcement.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    As a participant I solved some problems.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Why still no rating changes for div2? Over 16 hours from the end of the contest passed and still nothing

»
2 months ago, # |
Rev. 3   Vote: I like it +172 Vote: I do not like it

As a tester,this round is really nice,statements are short and clear and problems are interesting.

Wish you can enjoy the problems and get high rating!

Don't forget to upvote me XD

upd:Imakf why you steal the first comment >_<

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    as a participant i hope for +ve change in rating.

»
2 months ago, # |
  Vote: I like it +158 Vote: I do not like it

As a tester, the statements are short and pretests are strong and give me contribution XD

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

    Not so strong pretests apparently :/

    Why doesn't B have multiple testcases (like A and C have) to check for edge cases in the pretests?

»
2 months ago, # |
  Vote: I like it +120 Vote: I do not like it

As a tester, the statements are short and pretests are strong and give me contribution XD

»
2 months ago, # |
Rev. 2   Vote: I like it +25 Vote: I do not like it

Another Chinese round! It's a pity that I won't be able to participate in it because of my classes :(
Anyway, I wish good luck to all participants!

»
2 months ago, # |
  Vote: I like it +148 Vote: I do not like it

As a tester, I want contribution!

The problems are fun and interesting, so don't forget to participate!

»
2 months ago, # |
  Vote: I like it +104 Vote: I do not like it

Hope you all gain positive ratings Δ in this round!

It is theoretically impossible sadly :/

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

    It's not sad . If everyone gets positive rating then it won't remain fun and competitive.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it -26 Vote: I do not like it

      You could have it both ways.

      Create rolling sum that increases after each round, add the max rank to it each time. Each rank would be than sum + actual rank. Increases every time!. And yet distances between users stay the same! :D

      Yeah I know its silly and impractical. But it is possible.

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

    What if there was only 1 participant (initially rated 0) who solved all questions during the round? What about this "theoretical possibility"?

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      If it's his "2nd " account on CF

»
2 months ago, # |
  Vote: I like it +25 Vote: I do not like it

As a tester, the statements are short and pretests are strong and give me contribution XD

»
2 months ago, # |
  Vote: I like it +83 Vote: I do not like it

As a tester, I really recommend you to check your code carefully before submitting.

(btw : it's the first time for me to test in a CodeForces round)

  • »
    »
    2 months ago, # ^ |
    Rev. 3   Vote: I like it -51 Vote: I do not like it

    rui_er! /se

    upd: Why I got so many downvotes? I'm just a classmate of rui_er :(

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +47 Vote: I do not like it

    Well I really wonder why I got so many downvotes. Maybe you disagree with me, but this is just a kind suggestion, so please be more friendly to a person who is still a new hand but always tries his best to do every job. :(

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You are right!

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

    " I really recommend you to check your code carefully before submitting. "

    Well, you are right. But why you guys didn't make the pretests of B strong? I think it's easy to be done. :)

    • »
      »
      »
      2 months ago, # ^ |
      Rev. 2   Vote: I like it +25 Vote: I do not like it

      I'm really sorry if this makes you confused, but I'm only a tester (not problem setter), so I don't know whether the pretests are strong enough. I started my virtual participation and tested some solutions and the constraints. This is the first time for me to do this job, so maybe I'm lack of experience. I'm sorry again and I'll try to work better next time. :)

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

        Thanks for your reply. It's always hard to make something perfect in the first time. And I think you will do better in next contest.

»
2 months ago, # |
  Vote: I like it +6 Vote: I do not like it

Are contest timings decided by problem setters?

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

    Yes. This unusual timing is because the problem setters are Chinese and they have to go to school the next day (maybe.

»
2 months ago, # |
  Vote: I like it -43 Vote: I do not like it

Chinese round!!! Chinese time!!! I can take part in the contest at school!!!

»
2 months ago, # |
Rev. 3   Vote: I like it +90 Vote: I do not like it

Chinese Round is coming!

Gaining positive rating $$$\Delta$$$ is not the most important thing that you got from a contest. Passing interesting problems and benefiting from them are the core purpose of participating in the contest. Otherwise, if everyone only want to increase rating, the utilitarians may fill the community.

Of course, getting high rating can be your motivation for progress. But I also wish you not go against your original intention of studying Computer Programing.

And, good luck! XD

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

    Now found someone like me who also dislikes people yelling for rating here.Followed you buddy.

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

      Why would you dislike someone for having a different motive than you?

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

        I also don't have answer to this as somethings which are felt can't be described. It is a feeeeeling. I can't describe it.

        Remember in my comment yelling is not meant as motive. motive is something different. some people just freak out on social media if they gain something. some people just cry here in the discussion when they suffer huge delta this deviates the purpose of this blog. 100 / 400 comments in every round discussion says about. "Hope I become expert/ specialist/master today!.

        "Oh shit damn due to a silly mistake I lost 150 delta".

        "OMG what a tough round".

        "WTF the pretest 2".

        This all things are fairly common in present comments in the announcement pages . And ya most popular trend.

        "As a Tester ....shit"

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

          Everything aside, you are a legend man. You are from Ukraine, study in China and have an Indian meme as your dp. XD

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

    lmfao that said from your mouth lol

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You are quite right

»
2 months ago, # |
  Vote: I like it +79 Vote: I do not like it

China is an actually a good country :D

»
2 months ago, # |
  Vote: I like it -81 Vote: I do not like it

Wow a newbie testers

»
2 months ago, # |
Rev. 2   Vote: I like it -14 Vote: I do not like it

Attention, time is unusual !!!

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

    lollll :DD, I try to remind people but people don't like it =))

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It is really unusual,I don't have any time to pretend to be weak to my friends!:)

»
2 months ago, # |
Rev. 3   Vote: I like it +90 Vote: I do not like it
Maymay
»
2 months ago, # |
  Vote: I like it +117 Vote: I do not like it

As a tester, give me upvote!

Hope you can enjoy it. When you get stuck by one, you can just read problems after. :)

»
2 months ago, # |
Rev. 2   Vote: I like it +43 Vote: I do not like it

I saw lots of brilliant coder testing the round, maybe this means the contest won't be easy.

I want to become purple after finishing the contest(Daydreaming, of course.), so I'll try my best.

Hope everyone enjoys the fun of coding, like I do. Stay Cheeki Breeki :-)

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

    The contest being hard or easy doesn't makes much difference in ratings outcome maybe because The contest is same for everyone....

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

What does it means- " In the upcoming round, you can use only Kotlin. You can read the code examples here."

  • »
    »
    2 months ago, # ^ |
    Rev. 2   Vote: I like it +17 Vote: I do not like it

    That is for kotlin heros contest you can use only kotlin

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

    Why downvotes, it wasn't needed. I just asked.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Because your question was already answered. Plus, it's quite obvious that the announcement is for the Kotlin contest.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think the notification was for Kotlin Heroes: Episode 6 not for Codeforces Round #706 .

»
2 months ago, # |
  Vote: I like it +46 Vote: I do not like it

As a tester, the statements are short and pretests are strong and give me contribution XD

»
2 months ago, # |
  Vote: I like it +45 Vote: I do not like it

This is my second time to be a problem tester.Thanks to Imakf for giving this valuable opportunity.

The problems are well-prepared with interesting stories.Hope you enjoy them.

At last,good luck and have fun and get high rating

As a tester,please give me some contribution XD

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    (σ゚∀゚)σ⁶⁶⁶⁶⁶⁶

»
2 months ago, # |
  Vote: I like it +27 Vote: I do not like it

Aaeria

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

This is my first time to be a codeforces tester, I feel glad. Thanks to all of the writers!

This round will be very interesting.

Wish everyone good luck!

(The statements are short and pretests are strong and give me contribution XD)

»
2 months ago, # |
  Vote: I like it +9 Vote: I do not like it

Colorful testers :D

»
2 months ago, # |
  Vote: I like it -42 Vote: I do not like it

Imagine getting + delta in a div1 as a low purple

»
2 months ago, # |
  Vote: I like it -29 Vote: I do not like it

»
2 months ago, # |
Rev. 2   Vote: I like it +10 Vote: I do not like it

An Orange-blue Round XD.

»
2 months ago, # |
  Vote: I like it -41 Vote: I do not like it

why my contribution is in negative?

»
2 months ago, # |
  Vote: I like it -11 Vote: I do not like it

Feels great to see newbie in testers :)

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

As a grey colour, I'll solve A and attempt to solve B.

»
2 months ago, # |
  Vote: I like it -20 Vote: I do not like it

As a problem solver, I want some contribution, too. XD

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I hope the difficulty level is according to the score

»
2 months ago, # |
Rev. 2   Vote: I like it -59 Vote: I do not like it

The start time is too early. Sad, Chinese Round should be destroyed.

»
2 months ago, # |
  Vote: I like it -8 Vote: I do not like it

Good luck to everyone!!!

»
2 months ago, # |
  Vote: I like it -34 Vote: I do not like it

As a problem solver, I want some contribution, too. XD

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

    whenever you comment to get upvotes, every time get downvotes XD so please Stop now XD

»
2 months ago, # |
  Vote: I like it +20 Vote: I do not like it

May we know number of common problems between divisions?

»
2 months ago, # |
  Vote: I like it +52 Vote: I do not like it

As a resident of UTC+7 please give me more chinese rounds

»
2 months ago, # |
  Vote: I like it -40 Vote: I do not like it

As a contestant didn't do anything I want some contribution

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

At long there is a game whose time is suitable for me.

»
2 months ago, # |
  Vote: I like it -15 Vote: I do not like it

vote for the Dogecoin

»
2 months ago, # |
  Vote: I like it +12 Vote: I do not like it

It will be evening in India and will be missing playing footbal.. Hope I give it my all and make it worthwhile

»
2 months ago, # |
  Vote: I like it -14 Vote: I do not like it

As a participant, the statements are short and pretests are strong and I want +ve delta XD

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

What mean rejected problems? see about it in almost all contest announcements. Why everybody write about it?

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

    coordinator can reject problem, and it is often case if you are new in problemsetting

»
2 months ago, # |
  Vote: I like it +26 Vote: I do not like it

When you know you are going to lose rating, but still want to participate (Chinese round fact)

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

    For me, it's just like when you know there is a round today, but you have classes :(

»
2 months ago, # |
  Vote: I like it -29 Vote: I do not like it

At least the timing is reasonable. Usually its late and uncomfortable. I like it when I can actually make it a round without loosing sleep or having to turn up to work a dead beat.

»
2 months ago, # |
  Vote: I like it -51 Vote: I do not like it

After reading prob D(lets go hiking)- others — Try to solve the problem. me — lets leave this and starts searching for hiking destinations to visit post Covid.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Joined about an hour late because of classes and then not able to solve even a single problem. :( feeling bad

»
2 months ago, # |
  Vote: I like it -9 Vote: I do not like it

I fucking hate double in problem C I have right algorithm and because of double it doesn't accept on first pretest

»
2 months ago, # |
Rev. 2   Vote: I like it +51 Vote: I do not like it

No one tester noticed that statement of div1B is confusing? Really? I lost 0.5 hour and made 2 excess submissions because of that, and I am angry now

  • »
    »
    2 months ago, # ^ |
      Vote: I like it -25 Vote: I do not like it

    I am in similar pain because of other problems.

    Come on setters and tester could have done a better job.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve B ?
And what's wrong with this solution ?? WA

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    if mex is equal to n then ans is n+k otherwise answer can atmost be increased by 1.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your method for calculating mex only works for sorted array.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    unique_numbers is a value of unique numbers in array on the start.

    if mex < max then we have dont have a result of (Math.Ceiling((mex + max) / 2)) in our array then result would be (unique_numbers + 1).

    if mex < max and we already have a result of Math.Ceiling((mex + max) / 2) in array or k == 0, then result would be (unique_numbers).

    if mex > max then result would be (unique_numbers + k)

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your logic for finding the mex is not correct because the input is not necessarily in sorted order. For example, if the input was 1 2 0, then the mex you find is 1. But the correct mex for this input is 3. Try applying the same logic while iterating over the sorted set of elements after you have inserted every element into the set.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thanks mate. Now, I am Feeling like shit :(

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I think Problem C should not be in the position of C...

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Thanks authors for good problem setting. This time i haven't feeled myself as cryptographer who deciphers the cipher.

»
2 months ago, # |
  Vote: I like it -27 Vote: I do not like it

As a 中国人, I'm sorry I can't solve these problems. (Just started competitive coding with python)

»
2 months ago, # |
  Vote: I like it -10 Vote: I do not like it

What is in the 3rd pretest in div1C?

btw, div1B is elegant imo :)

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it
»
2 months ago, # |
  Vote: I like it -14 Vote: I do not like it

I want to cry, I want to rant, I want to do some things to some people.

I am sure I am not the only one with these feelings.

»
2 months ago, # |
  Vote: I like it +7 Vote: I do not like it

I think 1B should have highlighted the fact the two inequality signs are different for the two people's possible moves. Also I should learn to read better :(.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Turns out I wrote the wrong thing then ):

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

    Same to me. It seems that having wrong interpretation can pass all the samples and the first few pretests, especially when there is no explanation of the samples.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Wtf. I actually realized this after reading your comment.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Same T_T

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Same :(

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Can Any one tell why i am getting TLE? I am just using sort and sqrt functions This is my submission:https://codeforces.com/contest/1496/submission/109622532

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

    instead of double use long long for x, y because the comparison between doubles take more time than long long

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    multiset are very slow (something like 20 time slower than a sort), try with arrays of size n and counters to know where to add, or with vectors it should pass

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Whats the approach for Div2 D. I am getting WA on pretest 9.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

author should provide explanation for first test case of Div2D, I even asked them during the contest and they have responded as "no comments", this is not good.

»
2 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Div 1 D has such a scary time limit. I spent a bunch of time doubting if $$$\mathcal{O}(n^2 m)$$$ would pass, and it turns out my $$$\mathcal{O}(n^2 m)$$$ passed pretests in 2.13s/2.5s. It doesn't have any optimisations, so the runtime should be fairly independent of the input, but still, I'm scared of the systests.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

anybody who can explain what's the deal with using Fast io and setprecision together resulting in TLE for C ??

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Because you read the input in doubles when the input is integers. Doubles read for a long time. It will be faster if you read ints and convert into doubles.

»
2 months ago, # |
  Vote: I like it +11 Vote: I do not like it

I think the differentiation of problem C is TOO low.

»
2 months ago, # |
  Vote: I like it +71 Vote: I do not like it

[Div1 B] Am I the only one to not notice that the conditions for x and y are opposite and made 3 WA submissions?

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

    I also didn't notice that at first. Fortunately I spotted that before submitting anything.

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

    I noticed it now :(

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

what's with the 4th pretest of div2 c?

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

    Just don't take the container in which you are storing miners and mines of long double type, take it of int type. And rather take miner[i]*miner[i] + mine[i]*mine[i] as a long double variable to pass to sqrt function. And it passed for me after a number of Time Limit errors. Edit : also sqrtl() in place of sqrt()

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone explain their approach for Problem C ? Thanx in advance .

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    separate the x axis and y axis values and take the absolute values only . After that sort both x-axis and y-axis arrays . Now we can pair same index values in both arrays .

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    just sort x axis values and y axis values choose max from both

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

How to D?

  • »
    »
    2 months ago, # ^ |
    Rev. 3   Vote: I like it +9 Vote: I do not like it

    I am not sure if this correct approach , I think answer will be always $$$1$$$ or $$$0$$$ .Answer will be $$$1$$$ only when there exist some index $$$i$$$ such that array is decreasing in both right and left direction of index $$$i$$$ and size of the maximum decreasing sub array in both directions are equal,even and maximum in the whole array.

    Update this approach is correct : 109629126

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      ohk cool, never thought like that..never thought of anything..the problem just seemed impenetrable..was sitting blank for an hour xD.

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

    Rewrite input as mountain profile. Then first player only go down, and second player only go up. The players can't collide. First player should always start on peak. Otherwise, if he is in hole, he can't do any move, if he is on slope, second player can start under first player. Find for every peak its length to the left and to the right. If there are two peaks with same maximum length to the left/right, then first player always lose. Assume he starts on one peak, then second player will start on bottom of another peak, and since he is second, when they walk same distance, the first player will must do move. Now, we have the only peak with its length to left and right. This is the only position, where first player has chance to win. So the answer is either 0 or 1. First player wins if and only if the lengths of peak are equal in both sides and even.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Very elegant thanks..will try to implement!

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      First player wins if and only if the lengths of peak are equal in both sides and even.

      Shouldn't it be odd ??

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Oh, yes, depends on your definition of length. I defined length as number of edges: here $$$[1, 2, 6, 5, 4, 3]$$$ length to the left is $$$2$$$ and to the right is $$$3$$$.

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

In, div2 C, using a vector of double caused TLE, while a vector of long long passed the pretests :(

»
2 months ago, # |
Rev. 2   Vote: I like it +72 Vote: I do not like it

I misread statement from problem B and I thought that both players could make the same movements (I didn't see that $$$p_{y'} > p_{y}$$$). Goodbye div1 :(

I'm really surprised that all my submissions reached pretest 7.

»
2 months ago, # |
  Vote: I like it +33 Vote: I do not like it

When you read Div 2. D as py′<py and spend 1 hour solving the wrong problem ://

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

    That is bad problem statement. I did read it like 25 times before noticing.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Providing the explanation in problem D before hand would have saved a lot of time and maybe that could have been utilized in writing better solution.

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

    I was still solving it for the same until I saw your comment. Still getting a positive delta but could have done better.

»
2 months ago, # |
  Vote: I like it +3 Vote: I do not like it

What was Div1B Pretest 7?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Nice problem A.

»
2 months ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

Div.2 E / Div.1 C has elegant solution, just think about a pattern.

Spoiler

Upd. Managed to construct a solution which uses regexes (Perl): 109637022

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone explain why I got TLE in D2C? :((((

https://codeforces.com/contest/1496/submission/109611221

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why my code is wrong in Div2C?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    firstly the value you set ans to is too low, it can be up to 2 10^13, define it by the first value and it should become correct (to my mind). However, according to others bad experience, you should use vector of long long int and not long double because elsewise sort will be too slow on test 4

»
2 months ago, # |
  Vote: I like it +6 Vote: I do not like it

In recent contests I spent most of the time in asking myself, "How could I missunderstood the problem statement so that my solution does not work?"

Of course it is not allways the reason for WA, but if something does not work as expected, than usually such missunderstanding is the reason.

»
2 months ago, # |
  Vote: I like it +24 Vote: I do not like it

Would've really appreciated if the sample explanation for B were added beforehand. Thought the p’ > p signs were same for both players and solved for that. I take full blame for my mistake, but would've been nicer if at least one simple simulation were shown in notes, just sucks to lose so much time on a misread. Gotta be more careful I guess

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

in problem C, why is (https://codeforces.com/contest/1496/submission/109623109) giving WA? answers almost same but can't understand what is wrong

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    you must sort it in ascending order of their absolute values

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      same with me too. https://codeforces.com/contest/1496/submission/109620775 here is my submission. can anyone help plz?

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I dont know, can you use other functions for quicksort in c++, but you can put the absolute values to array. And your solve will become correct.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      why will it make a major differnce? can someone tell a test case where this part code would be wrong?

      vector<pair<int,int>> x,y;
         for(int i=0;i<2*n;i++)
         {
              cin>>a>>b;
              if(a==0) y.push_back({a,b});
              else x.push_back({a,b});
         }
         sort(x.begin(),x.end());
         sort(y.begin(),y.end());
»
2 months ago, # |
  Vote: I like it +26 Vote: I do not like it

The FST rate of div1B looks so scary...I am so curious about the pitfalls...

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why is this solution giving TLE for 1496C?

Question Link: 1496C Submission Link: 109603686

The solution is under the constraints and the approach and method is same as most of the accepted solutions that I have seen. Why is my particular solution giving TLE?

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

    use vector type long long

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Okay, using long long in vector worked, but why? Both long double and double give TLE, why? I have seen accepted answers using double in vector?

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

    dont use long double in vector

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

      Okay, using long long in vector worked, but why? Both long double and double give TLE, why? I have seen accepted answers using double in vector?

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I really don't know much about others.. But I've experienced this problem several times

»
2 months ago, # |
  Vote: I like it +183 Vote: I do not like it

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Please tell whats wrong with these solutions ?? (Today's div2-c)
Link1
Link2
I was at ~200 position after solving 2nd problem then there comes this problem :(.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    you must sort it in ascending order of their absolute values

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

    Use vector long long vect1,vect2 rather than long double vect1,vect2. I had the same problem made 8 submissions before making the right change. Sorting is O(nlogn) but there is considerable overhead sorting long doubles than integers. Stupid C++ :)

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I just want to know, why i have got WA in Problem C :( 109590727

»
2 months ago, # |
  Vote: I like it +22 Vote: I do not like it

Problem statement for this problem "Let's Go Hiking" was very fuzzy. It could have been more clear with test case explanation.

»
2 months ago, # |
  Vote: I like it +22 Vote: I do not like it

I think the number of pretests of Div2D/1B are too few...

»
2 months ago, # |
  Vote: I like it +13 Vote: I do not like it

Damn D's are failing fast.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I can't understand why I have got TLE for problem C in Div.2 for this solution: https://codeforces.com/problemset/submission/1496/109589906

but OK for this solution: https://codeforces.com/problemset/submission/1496/109596686

»
2 months ago, # |
  Vote: I like it -88 Vote: I do not like it

Downvote me to hell but no more participation in Chinese rounds and Russian middle school rounds.

Indians tend to prepare much much better rounds. Racist? Yes. Factually correct? Also yes.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

how to solve D div1 ?

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

    A solution should be available on the editorial, but here's an outline of my thought process.

    Precompute the pairwise distances between all nodes. Then, we'll compute the answer separately for each pair of nodes.

    The key observation is that a pair of nodes has answer zero if there are multiple shortest paths between them. We can prove that any edge on a shortest path from i to j must be in a BFS tree that can be rooted at both i and j, and if multiple shortest paths exist, this will necessarily create a cycle.

    The shortest path from i to j is unique if, for every d from 0 to dist[i][j], there exists a single node k such that dist[i][k] = d and dist[k][j] = dist[i][j] — d. We can check this criterion in O(n).

    Then, the BFS tree becomes a forest containing a tree rooted at each node on the shortest path from i to j. We can then show that vertex k not on the shortest path such that dist[i][k] = a and dist[j][k] = b must be connected to a parent vertex p satisfying dist[i][p] = a-1 and dist[j][p] = b-1. Therefore, we can compute the answer by multiplying together the number of possible parents for each vertex.

    We can thus deal with each pair of vertices in $$$O(n+m)$$$ time, so the total complexity is $$$O(n^2(n+m)).$$$

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks for this round!!! :>

»
2 months ago, # |
  Vote: I like it +15 Vote: I do not like it

There is a huge difference of who solved A,B,C and who solved A,B,C. :(

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How ?

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

      There are only 544 people Passed the D.So who passed A,B,C quickly will make great grade.

»
2 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hey could anyone explain when using long double rather than long long, its giving TLE on div2C?(https://codeforces.com/contest/1496/submission/109596148) (https://codeforces.com/contest/1496/submission/109613452) I know sorting has considerable overloads for long double but still wouldnt the complexity still be O(N*64*LOG(N*64))?

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Got TLE in div2-C but don't know why . can anyone help?? 109609708

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I did pretty much the same thing and got AC, not sure why your TLEs, let me know if you figure it out so I can avoid it in the future :D, anyway here's what I did:

    Spoiler
    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Just changed double x, y to long long x, y and it passed :)

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

Solution for Div.1 C : Consider partitioning about columns, that is mark complete columns as empty for columns 1, 4, 7 .... in 1 based indexing. Now between each 2 consecutive columns, if there is at least 1 cell that was originally empty, eg. in column 2 and 3 while considering columns 1 and 4, join both the columns using that row's elements in between them. Otherwise join them by the first row if no such empty cells exist. Finally if the number of columns are divisible by 3, we have to join the last column elements to the rest of the elements joined till now. To do that, for each such original empty cell in the last column, mark it's previous column (same row) element as empty.

»
2 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Again, not good presets XD

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it
  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    At least, we can show that the solution must be 0 or 1, but your output for test 5 is 57.

»
2 months ago, # |
Rev. 2   Vote: I like it -9 Vote: I do not like it

Why is Problem E easier than D —— even Problem B?

»
2 months ago, # |
  Vote: I like it +122 Vote: I do not like it

:D finally fst on 1B, because of some small bugs.

But it's still a nice trip, isn't it?

In the end, my rank reduced by 60. Luckily I still become an IGM, with various motions in my heart.

It's an exciting and unforgettable day for me, although this round maybe my last time to participate in a codeforces round.

It's time for me to stop studying Computer Programing, because of too many hard competitions and the stress of studying subjects. Otherwise I must try my best to become a top OIer in China, it's too hard for me ...

Wish you all good luck! And, thanks. :D

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Have a good trip and hope you'll achieve your target! :)

»
2 months ago, # |
  Vote: I like it +7 Vote: I do not like it

My code is printing 1 on my pc and ideone but on codeforces its printing 0.

Whats wrong?

mentioning: MikeMirzayanov

»
2 months ago, # |
  Vote: I like it +1 Vote: I do not like it

For div.2 C problem. Can someone tell me why is 109605593 getting TLE and 109609603 getting accepted when both are having the same logic?

Just printf statement is different. %.15f in one while %.15lf in second.

»
2 months ago, # |
  Vote: I like it +13 Vote: I do not like it

"strong" pretests for B. I think that there aren't too many situations but the pretests didn't include those. Anyway, you should consider all the possible situations. :(

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Pretests for problem D were very weak!! I mean look at the 30th case and 20th test case, how can one not include it in the pretests? Anyway it didn't affect my ratings but still those got WA on those test cases are unlucky :(

»
2 months ago, # |
  Vote: I like it +3 Vote: I do not like it

With many participants happened this: one of the solutions got TLE, the other one got OK, but they have the same logic (problem Div.2-C).

Why??

»
2 months ago, # |
  Vote: I like it +41 Vote: I do not like it

Thanks for the round! I thought the problems were very high-quality, and I enjoyed thinking through them for a few hours. (This was probably the most intense CF round I've ever taken--finishing C and solving D in the last ten minutes saved me on the order of 150 rating.)

One point of criticism: I'm not entirely sure why B did not use multitesting. There's no particular reason it would have been more annoying to write up if multiple test cases were included in each input, and this sort of problem (i.e., problems with only a handful of possible answers where determining which one is correct relies on checking some fixed criteria) always seem to lead some competitors to janky solutions that break down on relatively rare edge cases. The resulting FSTs would have been avoidable if multitesting was employed: for example, many solutions FSTed on a case with $$$n = 5$$$, and this could easily be prevented by a single batch test containing all inputs from $$$n = 2$$$ to $$$n = 7.$$$

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

Because of the pretest of div2D/div1B , lots of people are disappointed.

But you should consider all the details.

If you can't consider all the details , please improve yourself , do not blame the problem.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    but a wrong solution which passed pretest will make people relax vigilance

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

how weak 2D's pretests are!

  • »
    »
    2 months ago, # ^ |
      Vote: I like it -6 Vote: I do not like it

    sorry I accidently downvoted you .... consider you upvotes to be (current_votes+2)

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      sorry I accidently downvoted you .... consider you upvotes to be (current_votes+4)

»
2 months ago, # |
Rev. 3   Vote: I like it +8 Vote: I do not like it

Proof of Problem C that we should not have intersecting lines in the midway somewhere.
1615388314211

EDIT : D22 — D12 should be in the next equation. I hope you all can understand it. Please tell me in the comments if you have any issue in this. Also i missed to write +k when simplifying D22.

»
2 months ago, # |
  Vote: I like it +29 Vote: I do not like it

Nice contest, but author of problem F should learn the difference between a circle and a square.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Problem C

Can anyone proof it to me.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Less participation = -vve rating

»
2 months ago, # |
  Vote: I like it +57 Vote: I do not like it

As a tester of some past contests, did the testers who say "pretests are strong" really check the pretests? I sometimes checked the (sys.) test during testing, but I never see the tasks on Polygon(because almost always testers don't access or don't have READ rights on there) during testing and then I couldn't check which tests are included in the PT.

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

    This is a problem.. It seems like testers nowadays are just spamming "Statements are short and pretests are strong" to get contribution. Logically not every round they test can be that perfect, yet I see these comments on every round.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

waiting for rating change:)

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

messed up C due to overflow issues

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

.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone tell me why this doesn't work for problem B? I think my idea is correct.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    There is something called "Time Complexity". Learn it first...

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

      Ok, I don't know much about time complexity, but my code gives me wrong output, not TLE.

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        There are cases where the max of array is not constant such as case#4 (0 1 2) so you need to update your max_ hence the ans every round of k loop. In your code you keep it constant.

        • »
          »
          »
          »
          »
          2 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I was thinking about this, but can you help me how to do it?

          • »
            »
            »
            »
            »
            »
            2 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            import sys
            import math
            
            input = sys.stdin.readline
            
            for _ in range(int(input())):
                n, k = [int(i) for i in input().split()]
                a = [int(i) for i in input().split()]
                max_ = max(a)
                mex_ = [int(i) for i in range(n+1) if i not in a]
                if len(mex_) > 0:
                    res = min(mex_)
                else:
                    res = max_ + 1
                ans = int(math.ceil((max_ + res) / 2))
                for i in range(k):
                    ans = int(math.ceil((max_ + res) / 2))
                    a.append(ans)
                    if res > max_:
                        max_ = max(a)
                        res = max_ + 1
            
                print(len(set(a)))
            

            this is the "fixed" version of your code. it runs but this will TLE anyway because you actually don't need to go through this k loop. you can check my contest submission or the editorial.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i think change

     ans = int(math.ceil(max_ + res) / 2)
    

    to

     ans = int(math.ceil((max_ + res) / 2))
    
    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thank you, but it gives me exactly same output as before. On first test case: 4 4 3 3 3

      • »
        »
        »
        »
        2 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I checked your code and found two problems. First mex_ can be from 0 to n but your code check 0 to n — 1 change

            mex_ = [int(i) for i in range(n) if i not in a]
        

        to

            mex_ = [int(i) for i in range(n + 1) if i not in a]
        

        Second when append new value recompute max and mex value. Because it can change. But your code only compute once.