Imakf's blog

By Imakf, history, 3 years 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. csyakuoi
  4. sh_mug
  5. notTehlka
  • Vote: I like it
  • +580
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it +408 Vote: I do not like it

As a problem setter, I set some problems.

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

    As a problem setter, I set some problems.

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

      Tao God, eternal God! fkami, my superhero!

    • »
      »
      »
      3 years 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.

    • »
      »
      »
      3 years 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!

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

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

  • »
    »
    3 years 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?

    • »
      »
      »
      3 years 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.

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

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

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

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

      • »
        »
        »
        »
        3 years 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. :)

        • »
          »
          »
          »
          »
          3 years 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

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

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

  • »
    »
    3 years 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 ?

  • »
    »
    3 years 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.

  • »
    »
    3 years 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

»
3 years 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 >_<

»
3 years 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

  • »
    »
    3 years 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?

»
3 years 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

»
3 years 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!

»
3 years 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!

»
3 years 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 :/

  • »
    »
    3 years 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.

    • »
      »
      »
      3 years 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.

  • »
    »
    3 years 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"?

»
3 years 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

»
3 years 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)

  • »
    »
    3 years 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 :(

  • »
    »
    3 years 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. :(

  • »
    »
    3 years 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. :)

    • »
      »
      »
      3 years 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. :)

      • »
        »
        »
        »
        3 years 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.

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

Are contest timings decided by problem setters?

  • »
    »
    3 years 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.

»
3 years 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!!!

»
3 years 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

  • »
    »
    3 years 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.

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

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

      • »
        »
        »
        »
        3 years 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"

        • »
          »
          »
          »
          »
          3 years 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

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

    lmfao that said from your mouth lol

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

China is an actually a good country :D

»
3 years ago, # |
  Vote: I like it -81 Vote: I do not like it

Wow a newbie testers

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

Attention, time is unusual !!!

  • »
    »
    3 years 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 =))

»
3 years ago, # |
Rev. 3   Vote: I like it +90 Vote: I do not like it
Maymay
»
3 years 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. :)

»
3 years 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 :-)

  • »
    »
    3 years 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....

»
3 years 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."

»
3 years 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

»
3 years 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

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

Aaeria

»
3 years 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)

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

Colorful testers :D

»
3 years ago, # |
  Vote: I like it -42 Vote: I do not like it

Imagine getting + delta in a div1 as a low purple

»
3 years ago, # |
  Vote: I like it -29 Vote: I do not like it

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

An Orange-blue Round XD.

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

Feels great to see newbie in testers :)

»
3 years 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.

»
3 years ago, # |
  Vote: I like it -20 Vote: I do not like it

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

»
3 years 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.

»
3 years ago, # |
  Vote: I like it -8 Vote: I do not like it

Good luck to everyone!!!

»
3 years ago, # |
  Vote: I like it -34 Vote: I do not like it

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

  • »
    »
    3 years 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

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

May we know number of common problems between divisions?

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

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

»
3 years ago, # |
  Vote: I like it -40 Vote: I do not like it

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

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

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

»
3 years 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

»
3 years 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?

  • »
    »
    3 years 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

»
3 years 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)

  • »
    »
    3 years 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 :(

»
3 years 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.

»
3 years 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

»
3 years 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

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

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

  • »
    »
    3 years 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.

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

    Your method for calculating mex only works for sorted array.

  • »
    »
    3 years 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.

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

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

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

    Very easy or very hard?

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

      I actually write a math proof to verify my algorithm, but I believe there are people who had their fingers crossed and passed XD.

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

        Can you give proof?

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

          In which part?

          First of all you can move all the mines and miners at negative positions to positive positions, since this doesn't affect the distance formula.

          Then I simply try to proof that when using a line connecting miners and mines, there should not have any intersection.

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

      Very dumb

»
3 years 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 :)

»
3 years 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 :(.

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

    Turns out I wrote the wrong thing then ):

  • »
    »
    3 years 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.

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

    Wtf. I actually realized this after reading your comment.

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

    Same T_T

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

    Same :(

»
3 years 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://mirror.codeforces.com/contest/1496/submission/109622532

  • »
    »
    3 years 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

»
3 years 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.

»
3 years 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.

»
3 years 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 ??

  • »
    »
    3 years 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.

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

I think the differentiation of problem C is TOO low.

»
3 years 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?

  • »
    »
    3 years 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.

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

    I noticed it now :(

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

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

  • »
    »
    3 years 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()

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

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

  • »
    »
    3 years 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 .

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

How to D?

  • »
    »
    3 years 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

  • »
    »
    3 years 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.

    • »
      »
      »
      3 years 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 ??

      • »
        »
        »
        »
        3 years 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$$$.

»
3 years 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 :(

»
3 years 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.

»
3 years 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 ://

  • »
    »
    3 years 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.

  • »
    »
    3 years 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.

  • »
    »
    3 years 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.

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

What was Div1B Pretest 7?

»
3 years 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

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

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

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

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

    use long long int instead of long double, the sort will be faster (I know it's weird)

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

Why my code is wrong in Div2C?

  • »
    »
    3 years 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

»
3 years 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.

»
3 years 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

»
3 years 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...

»
3 years 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?

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

    dont use long double in vector

    • »
      »
      »
      3 years 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?

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

»
3 years 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 :(.

  • »
    »
    3 years 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++ :)

»
3 years 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.

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

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

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

Damn D's are failing fast.

»
3 years 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://mirror.codeforces.com/problemset/submission/1496/109589906

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

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

how to solve D div1 ?

  • »
    »
    3 years 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)).$$$

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

Thanks for this round!!! :>

»
3 years 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. :(

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

    How ?

    • »
      »
      »
      3 years 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.

»
3 years 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://mirror.codeforces.com/contest/1496/submission/109596148) (https://mirror.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))?

»
3 years 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.

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

Again, not good presets XD

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it
  • »
    »
    3 years 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.

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

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

»
3 years 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

»
3 years 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

»
3 years 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.

»
3 years 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. :(

»
3 years 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 :(

»
3 years 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??

»
3 years 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.$$$

»
3 years 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.

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

how weak 2D's pretests are!

  • »
    »
    3 years 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)

    • »
      »
      »
      3 years 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)

»
3 years 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.

»
3 years 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.

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

Problem C

Can anyone proof it to me.

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

Less participation = -vve rating

»
3 years 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.

  • »
    »
    3 years 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.

»
3 years 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.

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

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

    • »
      »
      »
      3 years 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.

  • »
    »
    3 years 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))
    
    • »
      »
      »
      3 years 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

      • »
        »
        »
        »
        3 years 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.

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

In the rating predictor why less positive delta is showing? On what factors rating changes are dependent upon?

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

    Don't worry about your rating (bhaiya), just enjoy problem solving (hacking)!

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

D is good and my clean implementation below.

109642740

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

submission 1: https://mirror.codeforces.com/contest/1496/submission/109647192 submission 2: https://mirror.codeforces.com/contest/1496/submission/109645519 can someone tell me why the first code is accepted and the second code is giving TLE ???

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

Hi guys. Something really strange happened to me.

Today I attended cf round #706. For some reason, it gave me this warning. During the contest, I resubmitted once and changed the "int" to "ll." Now im not so sure why it gave me this warning? Is there anything wrong with resubmitting the exact same solution of mine? I think there may be an issue with the system or something. Currently, my submissions are "skipped" for this recent contest: but I still don't see the fault of re submitting. Could you please take a look at this @MikeMirzayanov. If someone could help me fix this issue, that would be great. Thank you.

Upd: for further evidence, I received 2 messages from the "system," which means that I "copied the code from my own code."

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

?

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

FSTForces

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

In Div 1 E's sample,

I know 114514, 1919810 are famous (unhealthy) slangs for Japanese, and 2333.. is a slang for Chinese.

But I don't find the meaning of 19260817, 623532, 7175. Do they have special meanings?

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

    19260817 is the birthday of a famous man in China.

    623532 and 7175 is the melody of a song in Touhou Project I think.

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

In first line, I read "Daniel_yuan waiting" :p

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

May we know number of common problems between divisions?