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

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

It's been a long day without you, Codeforces!

We are glad to invite you to take part in Codeforces Round 969 (Div. 2) and Codeforces Round 969 (Div. 1), which will start on Aug/30/2024 17:35 (Moscow time). You will be given 6 problems and 2 hours and 30 minutes to solve them in both divisions.

The problems are authored by LMydd0225, tzl_Dedicatus545, _FJqwq, Ternary_Tree_ and me wyrqwq and mostly prepared by LMydd0225. One of the problems is also prepared by DitaMirika.

We would like to thank:

Hope you will enjoy the problems!

Score Distribution:

  • Div. 2: $$$500 - 750 - 1000 - 1500 - 2250 - 2750$$$;
  • Div. 1: $$$750 - 1250 - 1500 - 2000 - 2500 - 3000$$$.

badges$$$^\dagger$$$ of the authors:

$$$^\dagger$$$: Began in 2022 at NOI Shanghai, Badge Exchanging has been an activity popular among Chinese CPers. The host school for NOI 2022 decided to print badges containing the avatar of contestants for the contestants, and one can exchange his or her badge with another. The collection of one's badges (of other CPer's avatars) shows the group of CPers that he has met and even made friends offline. It has achieved great success. And since then, it has been a tradition for years.


UPD: Congratulations to the winners!

Div. 1:

  1. tourist (Updated, and congrats!)
  2. jiangly
  3. ecnerwala
  4. Radewoosh
  5. Kevin114514

Div. 2:

  1. mkrukov07
  2. temp6
  3. wjq1234567
  4. bingpao
  5. AuSquare (It seems that the rank 5 was banned? So let's move on to rank 6!)

The Editorial is out. You can also download Simplified Chinese Editorial in the contest material of the Div. 1 part of the contest.

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

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

thank you for no subtasks

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

    Subtasks are good though because if you normally solve n problems with subtasks you you might have a chance to solve n+1 (or n+0.5) problems. And normally I have noticed the first subtasks of problem n is either of the same level or slightly easier than problem n-1.

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

As the girlfriend of tzl_Dedicatus545, may you good luck & give me contribution!

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

hope this contest is good!wish me luck!

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

Score distribution looks really odd. I think it would go something like this, wouldn't it?:

  • Div2: Div2A — Div2B — Div2C — Div2D/Div1A — Div2E/Div1C — Div2F/Div1D
  • Div1: Div2D/Div1A — Div1B — Div2E/Div1C — Div2F/Div1D — Div1E — Div1F

Btw, the badge custom is really cool, I wish I could have done the same when I was younger T.T

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

As one of the authors, good luck & have fun!

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

As a tester, the problems were good and I recommend everyone to participate!

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

As a tester, the problems were good and I recommend everyone to participate!(

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

I tested this round, and I hope you all enjoy it!

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

As a tester, hope you have fun!

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

As a tester, when my solution has a different output from the example during testing, I suspect the author first.

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

    Fun Fact: The solution of Div.1 A was initially wrong when I tested the problem.

    Fun Fact II: 1A was in the position of 2C before we find out the mistake.

    Fun Fact III: There was another 1A before the current 1A was presented, and it was also wrong.

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

      I'm guessing this is referring to the sample with the same number of '1' and '0' leaves + '?' root + odd number of '?' non-root vertices? I feel like there would be a lot of WAs without that sample.

      I tried proving that that was the only "edge case" but just gave up and submitted after several hundred submissions AC'd :/

      I'm not even sure what you're supposed to do to solve that problem. Just be smart enough to prove it correctly and quickly, or assume that the samples are strong (which to be fair does seem to be a trend in As)?

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

Not as a tester, when can I obtain your badge wyrqwq

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

As a tester, I have two badges of one author but none of the other five XD

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

Time to get a color change in this contest XD

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

As a tester who hasn't participated a contest formally on Codeforces for nearly an entire year, I hope all of you a positive delta.

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

As a tester, it's a very good contest and hope u have fun!

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

The badges are so cute!! Reminds me of trading Pokemon cards :)

I wish I would meet many CPers in real life and exchange ideas too. Also, good luck to all!

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

hope to reach 1550

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

As a tester ,wish you have fun and gain positive rating delta.

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

I hope my downfall will come to an end this week

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

As a tester, I wish all contestant having fun in this contest.

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

What cartoon is this.....,,,??.???,???

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

is there any correlation between being weeb and high rating?

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

So as the photo says Problem D will be a graph problem?

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

Anyone know the sauce for the top right badge? Also interested in the others too. I think top middle is from "Bocchi the rock"

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

FreeDurov****

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

Were rating constraints for div 2 changed? Pretty sure it used to be 0-2099 yet I can't register(and don't see anyone with 1900+ rating registered).

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

    When Div.1/2 are hold separately, purple would belongs to div.1

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

    Separated Div.1 contests only requires 1900 although they're not very common now.

    It has been 4 months since last separated div.1 contest. Interestingly, last time we also have wyrqwq and N_z__ and some other people as authors and testers :D

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

badges looks nice I hope I can get one someday

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

All the best everyone. This time +100.

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

Based Kana Badge <3

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

Missing Ai (┬┬﹏┬┬)

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

Hope to solve ABCD for once in contest time. All the time I drop at C or B because of panic WA or TLE or whatever feeling is running in my head...

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

tourist gonna reach 4K finally!

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

As a tester, I missed the opportunity to compete officially in a great round! I hope you enjoy it!

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

The idea of badges is incredibly cool. I believe it should be extended worldwide.

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

The badges looks so cool!!!

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

Just curious to know if someone submit the same code in div1 A and div2 C is there a chance to get both his contests skipped.. like is the checker gonna check all codes from both the round together and search plagiarism or check the rounds individually?

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

    you can not give div1 if you are less than 1900, and you cant give div2 if you are rated more than 1900 if both happens at the same time, thus you can't give them together

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

I'm hopeful this contest will be both fascinating and enjoyable for everyone. Let's aim to boost our ratings and have a great time. Good luck, everyone!

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

As a tester, the contest is the GREATEST round I have ever seen!

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

As a tester,I just realized that it's the one I've tested and my rating-boosting dream was rained(T_T)///GL&HF everyone,not bad probs

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

As a tester,I tested the round.

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

As the boyfriend of the girlfriend of the tester yuanruiqi, may you good luck & have fun!

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

qp orz

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

It's been a long day without you, Codeforces!

lol

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

nice badges!!!!! :D

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

I love u wyrqwq

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

Good luck & have fun!

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

My first Div1,let's go!!

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

Hope it wont be bad for my first div1.

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

These Badges look awesome. How to get them?

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

How can one find cool avatars like these for CP accounts? Also, I hope the badge exchange tradition can make its way to international events... Great additional incentive to try reaching them.

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

The idea of badges is really cool!

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

The badges idea is so cool!

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

Wish to have a good problemset..

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

As not a tester, I hope to test it live

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

tourist just signed up... 3947 -> ?

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

I took part in NOI 2202, and Badge Exchanging was really impressive. Unluckily I got Iron Medal at that time. Now I'll reach LGM after the contest, which is very easy for me after -177.9 years of practice.

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

Rooting for Tourist to 4000!

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

Will tourist have a 4000 rating this time?The fate is coming.

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

my classes end at 6pm, it'll take me 90-120 minutes to get home, I'm not missing this one, I'll make it!

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

let get pupil rank with this one! cuyu fighting!

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

hope tourist will reach 4k

...

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

I watch anime, too. Why can I reach the level as the authors TAT

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

is this contest rated ?

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

as a participant, hoping to reach $$$1900$$$.

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

tourist winning this round is going to feel like Messi finally winning the world cup.

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

Mathforces incoming.

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

wish to cross 1800

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

i am not able to register for the contest please help

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

The grandmaster who commented its going to be an extremely chinese round was right. This is basically math olympiad not programming contest.

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

first time ever I decide to unrate contest after registration by making no submission.

problem A is wow, just wow, what the f**k is that

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

How to join, where is late registration?

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

:(

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

ARE U F KIDDING ME ????? WHAT DIV 2 A ????????

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

There is an option to unregister, can i unregister now?
I thought once the contest starts no action can be done regarding registration.

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

    There is no "unregister" but if you register and don't make any submissions, it will be as if you did not register

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

      When you go to contest page then in registered participants list, you will find the option but you can only unregister if you haven't made any submissions so far.

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

A: Guessforces B: I'm dumb for not reading the statement right C: Pure arithmetic, not really algorithm really

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

    Naming convention for B sucks. l and r is really misleading... should have used l/u for lower/upper bound or something.

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

      I think it was intentionally named like that just so that people would go the wrong path of using segment tree lol.

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

      true I started doing diffrence array method to calculate max then read PS again after 2WA

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

jiangly has solved all before tourist :( so no 4000 for tourist

sorry tourist for commenting too soon

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

I start hating cp because of this shit

and we all know that after testing not all cheaters are removed

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

he did it

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

tourist solved F!!!

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

Chinese rounds always shave off a few days of my lifespan, but I still keep participating in them

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

What a Contest tourist is ahead of jiangly by 5 points only

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

Nice round. No long queues, no Cloudfares.

Most importantly, we witnessed HISTORY — 4000 rating for tourist!!

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

tourist has finally become the first person on cf to cross 4000 rating barrier

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

tourist 4000 rating !!!

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

Is C really that easy? 5k solves...

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

    Even DuongForeverAlone found it difficult, but a lot of newbie didn't , lol

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

      The fact that I used $$$1$$$ hour in C before using the rest of the time for E, but no use. Come back to specialist soon.

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

        I will never do registered participation now onwards when the contest is Div1 + Div2 combined, author gets confused either it is Div1 problem or Div2.

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

      it is really just a normal div2 C but its using arithmetic not algorithms so he might not be good at it

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

        Not really. My performance went down significantly this month and I got my chain of 2 -> 3 problems solved each contest (which is pretty low if I want to maintain 1k7 -> 1k8).

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

    the problem A give away gcd idea. Hint is if you rephrase the problem into doing +-a or +- b for every c[i]. What's the min(max(c)-min(c))?

    After rephrase it you realize you can reduce a,b into just 1 number by taking their gcd. so the problem is +- gcd(a,b) now.

    Another hint is you should mod every c[i] for gcd(a,b). This is the pigeon intuition something(I dont remember lol, but the main idea is putting n pigeon into m closet. If (m<n) then 1 closet must have 2 pigeon.

    Then the rest is brute force over the sorted array O(n) times. Overall complexity is NlogN

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

      How can u do -a or -b?

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

      I solved it here basically its more like greedy idea,lets say n=2, u can make two number closest if their modulo by same number is also closer ,so sort array after taking modulo by gcd(a,b) then for every element in array from smallest to biggest you can always make it biggest number in array just by adding +gcd(a,b) to it and minimum will always be just next closest one on right .Note that this diff between both pairs of number will be least one from either be diff=(ai-ai+1) or gcd(a,b)+(diff)..*[ai<=ai+1]*,but in our problem we need ensure they are max and min in array so we choose gcd(a,b)+(diff) as a greedy approach on this sorted array

      278836498

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

orz tourist .. the legend has finally made it.. cheers

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

Please tell me I'm not alone by being bamboozled in this div2A...

Cost 30 minutes for coding gcd and brute force and a lot of time on thinking about optimize just to realized you are being bamboozled (but after this I can solve C in the right path! So maybe not bad at all)

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

tourist orz...

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

Poor Jiangly! Congratulations to the tourist with a rating of over 4000!

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

I was able to figure out the condition in Div1C/Div2F but couldn't think of how to implement it, Consider the set of elements in the subarray l to r, if we were to take the gcd of the consecutive differences of the elements in the set then the gcd must have a odd prime in its prime factorization, In this Case, the subarray is not brilliant.

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

    Got the idea maybe, We need to take difference of consecutive elements in the array and then use two pointers right?

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

      Basically, but you need to have a way to efficiently recalculate gcd when removing an element (segtree works, sparse table should work as well, there may be other ways), and make sure you don't screw something up if all of the numbers in a subarray are equal.

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

    What?

    I reached that for $$$n=2$$$ an array can be brilliant if the difference between the two elements is a power of $$$2$$$

    Intuition :

    Let the number of elements between $$$a_1,a_2$$$ be $$$Z$$$, I choose the middle element, then half of the remaining elements on the left will be separated from the other half on the right of the chosen average.

    So I went from difference $$$Z$$$ to difference $$$(Z-1)/2$$$, and I should always be able do divide $$$Z-1$$$ by $$$2$$$, so $$$Z$$$ must be a power of $$$2$$$ minus one, so the initial difference must be a power of $$$2$$$

    $$$2^n$$$ does not have any odd prime O_O

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

      I think he meant that the array is brilliant iff the gcd of differences doesn't have an odd prime factor (which is true for all subarrays that have at least 2 different elements; all numbers being the same is a special case).

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

tourist orz...

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

Wow, tomorrow we will see tourist with 4000+ rating, first in the history of Codeforces!!

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

Solve div2D at 02:27:30... This contest is really tough for me.

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

tourist orz

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

Yet another "Found bug 30 seconds after the end" contest for me... The problems are great though.

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

    Same, I found my error for Div2E 2 minutes after contest ended. If I had found my error 2 minutes earlier I would've likely gotten CM :(

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

can someone explain why this solution does not work for div2 problem D

https://codeforces.net/contest/2007/submission/278834900

isn't that all we need to do is determine if the root has a number? if it has, we only try to give numbers opposite to root's, else we can determine weather iris can give her turn to the opponent

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

    If I understood your code correctly, your way of checking whether Iris can pass the turn (the (qm&1) bit) uses the number of all question marks instead of using only the number of question marks in vertices that aren't leaves or the root (playing in other question marks doesn't pass the turn).

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

      yes you understood correctly but before this operation i put qm -= lq + 1 i subtract question marked leaves and the root

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

        Whst if the root is not question marked?

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

          If the root doesn't have a question mark, qm isn't used at all (in fact, this change only occurs if the root has a question mark), so it doesn't matter.

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

        Oops, my bad. I'm pretty sure I actually caught the mistake now: ln + (lq/2) + (qm & 1) should actually be ln + ((lq+(qm & 1))/2). When you have an even number of leaves with question marks, it doesn't matter if Iris passes until Dora changes the root or if Iris changes the root herself, she can always change the same amount of leaves with question marks (lq/2).

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

          ahh, i got ac with that

          when 6 seconds left i submitted with cout << ln + (lq/2) + (qm % 2 && lq != 0) << '\n'; but it didn't work. i guess i noticed the problem a bit late. thanks.

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

    What was your thought process for realizing that Iris can "win" an extra leaf by "passing" turn to opponent sometimes?

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

      actually one of the testcases forced me to realize that, i see if we play first, Dora can immediately give the same number.

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

        Ah yeah, I got that pretest wrong and my mind blanked... I was so convinced that Iris could only score 1 even after drawing it on paper.

        I guess it is important to observe that the first move is "useless," so by moving first, you are actually at a disadvantage.

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

how to solve d1C?

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

    I couldn't submit solution because of a bug, but it looks like the condition is $$$GCD(|a[l + 1] - a[l]|, |a[l + 2] - a[l]|, ..., |a[r] - a[l]|)$$$ must be a power of $$$2$$$ (or $$$0$$$). It is the same as $$$GCD(| a[l + 1] - a[l] |, | a[l + 2] - a[l + 1] |, ..., | a[r] - a[r - 1] |)$$$ and then you need a sparse table to find these values fast for each left position $$$l$$$.

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

      wow, thats cool! can you plz explain why it works?

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

        Consider all possible values of $$$A[j] - A[i]$$$ on a segment and find their GCD $$$g$$$. If $$$g$$$ is $$$0$$$: all elements are the same, segment is good. If $$$g$$$ is a power of two you can just fill all the gaps between the numbers so that each of them is in the set. If $$$g$$$ has any prime divisor $$$p$$$ rather than $$$2$$$ -- all elements will have the same remainder modulo $$$p$$$. Since $$$p$$$ is odd, that means for all adjacent numbers in the set $$$x + y$$$ will never be divisible by $$$2$$$.

        And then you can just prove that GCD of all pair-wise differences can be found as the GCDs I've mentioned above.

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

      You don't want to have $$$a[l]$$$ in there: if your subarray was $$$[2, 8]$$$, this would give you gcd $$$2$$$, which is a power of $$$2$$$, yet the subarray isn't brilliant. Otherwise, yeah (also, you can use a segtree instead of a sparse table, but that doesn't matter).

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

great problems! sad that limitations in E are so high :( didn't have time to figure out how to improve $$$O(n \log^2 n)$$$ to $$$O(n \log n)$$$.

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

    Same (i figured out while impelementing nlog&2 in last 15mins but no time to switch then? ), but nlog^2 passed in 1s

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

      We had no way to make $$$\mathcal O(n\log^2 n)$$$ TLE under the 4s constraint, but IMO it is harder than the intended $$$\mathcal O(n\log n)$$$, so I think it is unnecessary.

      And it seems that $$$\mathcal O(n\log^2 n)$$$ solutions are just with 2 logs, it cannot be improved to 1log...? I don't know because I am not very good at data structures )

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

        it can be improved though? I can keep a frequency array of dimension log instead of a segtree

        I think if you can't tle something (my code wasnt even that optimized and it passes in 1s), consider letting it pass freely. IMO its more fair this way

        Also if you have a template of segtree, nlog^2 is easier (atleast to me). nlogn needs additional ideas.

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

      I had centroid + std::sets. TLE test 9. But I submitted at the last minute, maybe I would be able to optimize it if I had more time.

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

        Mine was super quick log^2

        Just a for loop + iterative segtree

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

          I guess I can replace an std::set with an iterative segtree too... Probably should've done that.

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

Smart-Select-20240831-020606-Chrome

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

Was anyone able to pass HLD in Div1B?

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

How is tourist that invincible?

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

how to solve C?

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

    the funny thing is that it has 5k AC

    it's not this easy to get all of this but thx to cheaters actually

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

      It's about average div 2 C though :/

      Maybe get better?

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

        bro, u haven't seen the number of submissions in the last 30 minutes for C & D

        and for sure I already solved it in the first hour, but seeing this is too annoying

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

          I agree, I just think it was nothing unusual compared to other contests. It's, like, the stable amount of cheaters, The Horde of Disgrace.

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

    First let's imagine you have only A, not A and B. Then you can fix the difference between values if it's not smaller than A. e.g. A = 5, values = 5, 10, you can make diff = 0. But if it's 5, 11, the lowest diff is 1.

    Second, now we have A and B. If you have A = 5, B = 10, then B is useless, because A * 2 = B... or, actually, because GCD(A, B) = A! So now we have a clue. If GCD is 1 (e.g. A = 5, B = 9), we can ALWAYS make a difference of 0!!

    The idea: calc gcd(A, B), then for every number get it's Value % GCD(A, B). Maximum of this array — minimum of this array is your answer... UNLESS...

    Let's say GCD is 7, and you have values 1, 6. But 1 + 7 = 8, and 8-6=2 is better than 6-1=5. So now you need to actually iterate the array of values % gcd(a,b) you got before to see if you can optimize the solution by adding to the values[i] your gcd. Though to understand this there were steps in between that I have missed in the explanation.

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

If no fst.Tourist will get the first 4000 rating. Congratulations.

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

The 4-th sample of D1A reduced it's difficulty a lot. Otherwise it's problem rating could increase by 100.

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

    Yes! I debugged using that case. Maybe authors want to make A a bit friendly (?)

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

This div means how to make people hate PS.

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

I've never experienced so much skill issue solving a div2A q.q

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

    Experience with GCD problems was required for the A, I think... and for the C as well... GCDforces.

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

      Funny thing is that I've immediately noticed bezout's identity on problem C but couldn't figure out that any 3 consecutive numbers, with the first one being odd, are coprimes (fro problem div2A) :/

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

        How do you solve C with bezout's identity. I just know it means ax+by=gcd(a,b). For C I realized that eventually the difference between possible linear combinations of a, b with different positive x and y integers converged on gcd(a,b) if you sort all the unique values that were generated. So you get a difference array that will eventually [....,gcd(a,b),gcd(a,b),gcd(a,b),...,gcd(a,b)], just be gcd(a,b) at the end.

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

          You actually used the theorem. It state's that gcd(a,b) is the minimum positive value we can get from a*x+b*y with x and y as integers. From what I understood of your comment it seems you just did not fully understand the theorem, and treated this as an unrelated observation. Sorry in advance for any misunderstanding.

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

          I will explain to you my solution for the div2C problem. The first step is to understand that, by using bezout's identity, we can add or subtract (by adding it to every element except one) a multiple of G := gcd(A, B) to the elements of array C. That means that we can shift backwards all elements of C so that C_i := C_i mod G. Sorting all elements (C_i mod G) and keeping them distict, it's a matter of asking if there is a prefix that is useful to shift forward by G (for example, if I had the elements 1 mod 5 and 4 mod 5, it would be useful to see the 1 mod 5 as a 6 mod 5, making the solution 6-4=2 instead of 4-1=3), which means finding the smallest [ C_i + G - C_(i + 1 mod N) ] mod G in O(N).

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

            bro just please tell how to get intuition of shift back thing or minus thing it's like the operation is plus how did you know that minus won't make any differ this is very hard to observe for me

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

              Honestly, when I first read the problem I assumed that you could subtract, only after the contest ended I noticed you could only use addition lol. You could get the intuition for using subtraction by noticing that it would really be useful if you could subtract A and B, unlocking bezout’s identity, it’s just a matter of justifying why is it possible.

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

      C was great imo.

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

      I got rekt in A just to have a better start at C, so maybe it's fair trade in div 2 after all

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

lost a ton of rating but atleast it went to good cause
Finally 4000 gonna be breached

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

Some very cool problems, thanks a lot to the organizers! :)

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

Passed the example of D 5min after contest ends...

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

f**k me and my understanding for B , dammnn

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

The little boy from Belarus on behalf of every little boy wearing his shirt. Tourist on a million backs, Tourist for a million flashbulbs.

Gennady Korotkevich aka Tourist becomes first ever competitive programmer to cross 4000 rating mark on Codeforces.

Greatest programmer to ever exist!

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

A and C were uh, peculiar problems, but very well written and thought out.

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

hardest Div2A I've ever seen. 40min of thinking with 0 progress .. euler totient? integer sieve? how it is possible

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

Hints for Div2 C?

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

Can someone explain why I see this?

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

    It's Chinese editorial. English editorial will be published soon (probably since the translations are done).

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

I had the logic for D but my bad implementation trolled me :(

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

    Yeah, kinda sad there's no in between in codeforces (it's not like it's really possible to implement such system in a good way though), I'd imagine a half-grade for the idea... but when you have one and can't implement it (because there's some case you are missing despite the fact it's working), you get nothing, it's heartbreaking.

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

      i could implement it but 1 error in a part of the code cost me the wa in pretest 2

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

        I edited my answer, I've meant exactly this. have this case:

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

GOAT tourist !!Can someone tell me the rule that the problem score in div1 decreases with time?

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

I've spent a significant amount of time trying to solve Problem B , then I realized the problem I am trying to solve is not B.

How bad a problem statement can be? => This bad.

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

As a competition on Codeforces, I believe there are too many data structure problmes in this game. Both D1D and D1E require some data structures to maintain, and most of D1C's practices also require the use of data structures. These questions are not difficult in terms of thinking, but they require a lot of time to write code. I don't think this is in line with the style of most Codeforces competitions. At the same time, D1E allows the time complexity $$$O(n\log^2 n)$$$ approach to pass when there is an $$$O(n\log n)$$$ approach, as long as you write it well, but in reality, this approach is not difficult to think about, only requiring some template code to be combined and slightly modified. I think this game is more focused on testing code implementation ability rather than short-term thinking ability. If it is played under the IOI format, it may be a qualified game, but it is not suitable for Codeforces. Or, in other words, it pioneered a new style of codeforces div1 competition ;)

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

    nvm

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

    D1D doesn't require a data structure other than prefix sum. My code for C and D was shorter than for A and B, with some thinking you don't need to use any data structures and the implementation is quite short for both C and D.

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

Is there any time limit set for two consecutive comments and more than 4?

" You can write no more than 4 comments in 60 minutes "

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

Releasing Chinese editorial before the English one??

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

Maybe only me got FST on Div1, Ofast + unroll-loops maybe harmed me >< 278842172 278846221
During the round I got PT passed and PT=ST but I got WA-FST, very strange...

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

Thank you, tourist, it was the best and most epic live broadcast of my life!

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

Too much math to be honest.

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

mfw I'm 5 minutes away from AK div 2 ToT

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

Aug 30th: World tourist's day.

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

nice

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

I think people are more excited on tourist reaching 4000, than tourist himself

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

MANNNNNN I got cooked so badly :( All because of Div. 2 A

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

One day I will be at top++ like tourist

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

history created.....

welcome to new world -> 4000+ tourist

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

The worst Div2 in the whole summer

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

My dream is lgm ✖️ My dream is Tourist ✔️

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

tourist became Tourist. What a moment. I was here. I was a part of this history.

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

The Tourist has passed Codeforces; he needs Codeforces 2☠️

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

I need RUSSIAN editorial at RUSSIAN website pleaseee

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

The contests was epic. I haven't seen such good problems in a very long time.

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

Maybe it's better to update the post so that we can see his new color.

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

Why do Chinese authors like multiple test cases so much? It almost reminds me of the days when I worked on HDU problems all day

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

    It has nothing to do with Chinese authors, pretty much every CF rounds uses them a lot. Making strong test cases without the multiple test cases per file can often be very hard, so people use $$$10^4$$$ test cases per file to put every small case in one file to catch WAs a lot more easily.

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

Guess difficulty

Div2A — 800

Div2B — 1000

Div2C — 1400

Div2D/Div1A — 1800

Div2E/Div1B — 2200

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

LIE