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

Автор waaitg, история, 21 месяц назад, По-английски

Hello, Codeforces!

Imakf and I are glad to invite you to Codeforces Round #808 (Div. 1) and Codeforces Round #808 (Div. 2), which will take place on Jul/16/2022 17:35 (Moscow time). 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.

Wish you all wouldn't gain negative ratings in this round! (This is theoretically possible XD)

UPD1: Score distribution is

Div 2: $$$500 - 1000 - 1500 - 1750 - 2250 - 3000$$$

Div 1: $$$500 - 750 - 1250 - 1750 - 2500 - 3250$$$

UPD2: Editorial

UPD3: Congratulations to the winners!

Div 1

  1. Isonan
  2. djq_cpp
  3. tourist
  4. jiangly
  5. Um_nik

Div. 2

  1. _WidowMaker_
  2. N193r
  3. Ayaka_s_Dog
  4. PaiGuChicken
  5. NothingOccurred
  • Проголосовать: нравится
  • +280
  • Проголосовать: не нравится

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

1-gon 可爱 1-gon cute.

Hope everyone enjoy the round.

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

Expert, I'm coming. EDIT : it came true

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

Can't wait to see PinkieRabbit's performance!

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

Thank you for the great round!I can't wait to try my best to solve the problems!

And hope seniors can enjoy their university lives in the future!

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

As a tester and a fan of cute Imakf, love the round so much!
Hope everyone enjoy it!

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

    As a tester, I disagree with this part of the announcement:

    Wish you all wouldn't gain negative ratings in this round! (This is theoretically possible XD)

    Historically, that almost certainly means us testers made a mistake or there's a CF meltdown and the round becomes unrated.

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

    As a contestant, I don't believe testers anymore.

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

In the last round, I passed three questions and I hope I can reach 1200 points in this round.

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

Wish you all wouldn't gain negative ratings in this round! (This is theoretically possible XD)

hope so (XD)

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

Hopefully I don't lose expert.

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

    Same! I also just recently got it, we are living on the edge here. Good luck!

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

      yeah you too man.

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

        Well, that definitely didn't go very well... I'm lucky I won't drop to Pupil after this round.

        Guess these will be my last words as an expert in the foreseeable future :/

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

          Same man, I think I've got a valid sol for C (after the contest!) I got seriously unlucky lol.

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

            I feel you. It's funny we fell down to very close ratings too. Better luck to us on #809 I guess. The journey back to expert begins!

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

    Hopefully I don't lose CM

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

Respect smg23333!!!!

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

Wish you all wouldn't gain negative ratings in this round!

So this is unrated?

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

One of my curious questions: How to become a Codeforces Round tester? Sounds interesting

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

I can't wait to see jiangly's performance!

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

Today is my birthday. Hope this contest is as special as my birthday

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

respect++ for smg23333

You can take away my house, all my tricks and toys. One thing you can't take away, is my csgo time. ~ Iron Man
»
21 месяц назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It says it is theoretically possible that no one gets negative rating.

Someone knows how?

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

photo-2022-07-16-16-43-46

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

wana to be a Specialist ... ovo ...

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

Deleted

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

Deleted

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

Is there a way to find out if a specific user is registered for a contest (before the contest begins)?

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

let's see how bad I'm going to do after solving only 100 problems this year and the last submission was more than 2 months ago and the only algorithm i still remember is implentation

Edit: Well I started with C and it was a bad plan

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

Is this div.0?

I've checked the title of this contest for 3 times, I think this is div.1 but the problems are more like div.0.

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

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

"Wish you all wouldn't gain negative ratings in this round!" Wow!! I think all will gain negative ratings in this round XDXD

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

It just feels bad when i am a second year CS university student and can't solve A.

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

    oh, I thought I'm the only one who can't solve A problem, it's hard as """"

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

God, I felt so useless when I took that much time to solve A with solid proof, until I saw comments. Feeling so idle in this contest :)

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

Can't solve 2C. Lower rating :(

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

Капец, C легче A. Люди, как такое возможно?????

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

I don't know why my codes for A,B are WA

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

One of my worst contests ever! I will never join Chinese contests again.

The contest is not balanced. The last Div2 round was very balanced but this contest is just a fast coding contest with some sh!t.

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

    It doesn't mean all Chinese contests are like this one.

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

      I hope so.

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

        What are you saying. If you solve the problems normally, the round will be cool. The problem is not in the round, but in you. It's not speedforce. I agree, maybe we need to swap A and B, but no more!!!

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

    Why do you think so? I also think this round is not good enough(Exactly last round too),but it is absolutely not a fast coding contest.

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

From Newbie to Pupil to Specialist to Pupil to Newbie. What a Journey :)

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

There is a big gap between B and C

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

I am that point when there is nothing left to think about A, B, C

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

Every time a problem with '0' and '1' appears in a contest,

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

I can feel what Doremy is going through :(

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

Can someone give me a hint for Div2D?

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

A) Prove by AC, somehow works. Spent 20 mins on it, thought about rage-quitting without making submissions because it seemed like I won't be able to solve even A or B :lol:

B) Until the very end of the round I was convinved all elements also have to be distinct, so had no idea how to approach it and solved it only at the very end

C) Prove by AC, no idea why it work and whether it really works or problem just has bad pretests

D) A bit of reasoning lead to solution convincing enough. Quite a cute problem. Logic seemes easier than A/B/C

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

    Can you please explain your reasoning for D. Thanks

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

      It is pretty much above

      Note there cannot be many unique values in the array

      Think how to avoid useless computations, repeating values don't add much new. They add zeroes and further zeroes again produce zeroes

      So you just keep track of the number zeroes and observe how the process quickly converges on all the other values

      Well, that's the idea.

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

    Same lol for B

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

D1B editorial. Also it's my only authored problem lol.

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

"Wish you all wouldn't gain negative ratings in this round! (This is theoretically possible XD)", That's when we should have known that the contest would have been a disaster.

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

For Div1C, is this wrong or does my implementation just suck?

Let T be the MST of the graph. Since edge weights are not repeated T is the only MST.

Then a root R is good if and only if for all edges (u, v), at least one of the following hold:

  • (u, v) is in T

  • When T is rooted at R, u is an ancestor of v or v is an ancestor of u.

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

Pretty brutal contest. Very humbling, can't wait for the editorial.

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

Whats wrong with my code? am using PB_dS with reverse traversing and putting max value + 1 every time i check more than q

Code
»
21 месяц назад, # |
  Проголосовать: нравится -21 Проголосовать: не нравится

Div 2 A is trash

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

POV: no one can feel my pain The pain: 8 wrong submissions in B

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

Problem C is just like my friend. His name is Long. \

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

How can I pass problem 3?

»
21 месяц назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
How wrong is my solution for C ?
»
21 месяц назад, # |
  Проголосовать: нравится +22 Проголосовать: не нравится

Dear authors, shouldn't it be said in B that numbers can be equal? I love you very much, kissing you for the great time!

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

    or at least give a sample case where numbers are equal

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

    Well, it is our fault in a sense that we don't read statements properly. But yeah, they could make it clearer.

    Solved B only at the very end because of it

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

    I got 2 WAs in problem B because of this :')

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

    I did not solve the problem because I thought the numbers should be distinct. But that is my fault since it was not stated that they should be distinct. Even the examples did not have any equal numbers to make it clear.

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

No more algorithm-reading problems plz No more algorithm-reading problems plz No more algorithm-reading problems plz

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

Ouch, the power outage plus the problems were the final nail in the coffin for me.

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

Sorry to say but A, B and D are one of the worst problems I ever solved. C was pretty good though.

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

    It could have been much better if the authors asked just to output the number of solved contests, because then a DP approach with segment tree/SQRT-decomposition on top of it could work without greedy approach.

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

      Can you elaborate on the DP approach?

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

        Yes, of course. Let dp[i][q] be the maximum number of tested contests if we consider only first $$$i$$$ contests and after testing or skipping $$$i$$$th we have IQ exactly $$$q$$$.

        At first, let's solve in $$$O(n^2)$$$.

        for each i:

        1. $$$a_i \le q$$$. for each q, dp[i + 1][q] = dp[i][q] + 1.

        2. $$$a_i > q$$$. for each q, dp[i + 1][q] = dp[i][q], dp[i + 1][q - 1] max= dp[i][q] + 1.

        Let's note that in the second case dp[i][q] + 1 is always no less than dp[i + 1][q - 1], so we can replace max= with =.

        Okay. Now let's maintain the difference array of dp[i]: diff[j] = dp[i][j] - dp[i][j - 1].

        When we increase i, we simply need to

        1) add 1 to diff[a[i]], substract 1 from the last element of diff (this is the case $$$a_i \le q$$$

        2) set the prefix ending with a[i] to 1 (case $$$a_i > q$$$)

        This could be done using a segment tree or SQRT-decomposition.

        Because q cannot decrease more than $$$N$$$ times, we can keep just $$$N$$$ values of diff.

        But I don't see a way how to recover the answer...

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

      You can record the pos of the dp-ans,and then output answers according to this.

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

        Could you please elaborate on that?

        I've explained my solution here.

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

          Will,my dp solution is diff from yours XD

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

            Could you please explain yours?

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

              OK I just realized my solution may be not dp(although it is from dp sol), sorry :(

              I just do it from n to i.

              make c[i]=(a[i]>q)

              Notice that if c[i]=1 and i is picked,then all of c[i]=1 in i+1 to n must be picked. (When I didnt notice this I use simply dp to do it)

              set dp[i] as the best answer when you deal with i to n,and c[i]=1,and dp[i] can be claced by dp[nxt[i]] (nxt means the next 1's pos)

              Here we can use BIT or priority_queue to solve. Actually it is not dp eventually (I came up with it according to O(nq) dp sol).

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

div2c was binary search ?

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

what's wrong with this approach of Div2 C. Any counter testcase? It gives WA on TC 3

code

upd: got it

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

Did you guys use prime factors to solve problem B? Bruteforce just got a TLE

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

    Used simple math for O(1)

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

    You don't need any prime factors or anything like that. My idea was: the last element should be divisible by $$$n$$$, the second last should be divisible by $$$n-1$$$ and so on because $$$gcd(i, a[i])$$$ is always $$$i$$$ in that case. All $$$i$$$ are different so it is the correct solution.

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

      Yep. i got the same idea. But i was traversing [l, r] round and round to get the proper a_i which fulfills gcd(i, a_i) = i. And got a TLE

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

Problems are not bad, but the problemset is too hard :(

»
21 месяц назад, # |
  Проголосовать: нравится -7 Проголосовать: не нравится

Congratulations, you're now officially interlude 2.0

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

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

Very INTEREST Round! I have never got the place on div2 before

pC is very nice

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

what a shame how could I miss such a cute contest! :,c

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

A was torture for me.

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

weak pretests and lack of explanation for problem B

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

About how my Div1D gets FST: somehow creating a vector and resizing a vector $$$O(n^2)$$$ times magically make my code 5x slower.

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

I was thinking C for more than 40 mins like what exactly I could do...just read the tutorial and found that it was an easy problem :). just didn't get the right approach:(

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

Ratings updated preliminary. As I said here: https://codeforces.com/blog/entry/104766?#comment-932270 cheaters will be removed later.

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

My submission for B no problem I can not find any test case that can fail.Can anyone help me with a failing case??

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

    numbers don't have to be distinct.

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

      ""such that gcd(i,ai) are all distinct"" Distinct was mentioned

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

        Dude gcd must be distinct but the ai can be the same.. suppose an array of 2 numbers 1000,1000 have gcd's with the index's as 1,2 respectively, gcd's are different here but numbers are the same:)...what I get is that u have encountered that ai must be different.. if that's not the case still finding the mistake:)

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

Thanks to this contest, I had become LGM!!!

appreciate very very much for writer and tester!

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

my friend:“Hello!” me:“How do u know I become a Expert?”

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

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

Fortunately I miss this round(I have registered but forget ha) Only 2k solved pC Are you sure this is div2???

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

Anybody knows the solution for B if all ai were to be distinct between one another?

(meaning that for any l <= i, j <= r and i != j: ai != aj)

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

candidate master, I'm coming :>

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

Please don't use questions from other websites . Question d of div 2 or question b of div 1 was previously asked in codechef starters 33. https://www.codechef.com/START33B/problems/ARRAY_OPS . This gives unfair advantage to those who have seen the question previously.

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

why my rating is rolled back which I gained after giving this contest any help