Блог пользователя manish.17

Автор manish.17, 5 лет назад, По-английски

omg hi Codeforces!

ScarletS, flamestorm, fishy15, saarang, lookcook and I are glad to invite you to our Codeforces round, Codeforces Round 766 (Div. 2), which will be held on Jan/15/2022 17:35 (Moscow time). This round will be rated for participants with rating lower than 2100.

We would like to thank:

You will have 2 hours to work on (and solve!) 6 problems. There will be at most five hundred interactive problems in the round. Make sure to read this blog and familiarize yourself with these types of problems before the round! You are highly encouraged to read all the problems ;).

Good luck, and see you on the scoreboard!

UPD1: Thanks to the testers competitive__programmer for making video editorials for most of the problems, and namanbansal013 who will be streaming solutions after the round!

UPD2: The score distribution is $$$500-1250-1250-1750-2000-2750$$$.

UPD3: The editorial is available here.

UPD4: Congrats to the winners!

Div. 2:

  1. wk___tzc

  2. Alan_boyfriend

  3. proton1126

  4. raingirl

  5. yincheng01

Div. 1 + 2:

  1. neal

  2. qazswedx2

  3. hitonanode

  4. Bench0310

  5. m_99

We hope you enjoyed the round. Look forward to our next one!

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

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

As a problemsetter, each upvote on this comment equals one time I'll roast saarang

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

As a tester, I was very useful!

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

looks like this one is skribbl bois round :catthink:

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

As a tester, I can guarantee this round will be very geniosity!!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -10 Проголосовать: не нравится

$$$OMG$$$ ! What's the difference between $$$ indian $$$ $$$ round $$$ and other $$$rounds$$$ ?

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

As a tester, I believe the problems are great. Do make sure to read all the problems and I hope this contest turns out to be a good one for you :)

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

As a very big fan of both fishy15 and ScarletS, I know this contest will be as geniosity as they are.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится
Things to notice ;)
»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +136 Проголосовать: не нравится

The only way I got ScarletS to do work for the contest

Spoiler
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +99 Проголосовать: не нравится

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

Why srk is in the tags :)

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

How can all problem setters be from different countries! Quite Amazing

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

As a tester, I should probably think of something interesting to say :v

But I have no brain so give contrib pls :v

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

As a tester, each upvote on this comment equals one time I will save saarang from ScarletS's roasts. So if you like saarang do upvote. And also yeah, since we were paid to appreciate the contest, please do participate! The problems are quite luv.

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

As a tester, please participate in this contest and give me contribution.

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

As a tester, I'm here to claim my contribution.

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

lookcook ORZZZZZZZZZZZZ

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

Not sure if I'm allowed to disclose this information, but hey, there will be at most 6 interactive problems in this round. Don't tell anyone though, keep this sacred knowledge as it is your competitive advantage!

»
5 лет назад, скрыть # |
← Rev. 5  
Проголосовать: нравится +10 Проголосовать: не нравится

.

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

As a tester, hope you have a decent day.

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

There will be at least $$$-494$$$ non-interactive problems, as long as I did all the math correctly.

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

This round's editorial will probably be published earlier than #765

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -23 Проголосовать: не нравится

"There will be at most five hundred interactive problems in the round" why????????

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

Really excited for this one.

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

Is every problem in this contest interactive ?

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

As the official video editorialist for most of the problems, the problems are very interesting and I will try my best to explain the solutions in an intuitive and simple manner. The videos will be available on my YouTube channel after the contest ends. Don't forget to like the videos and subscribe to the channel if you find them useful.

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

Thank you for preparing this wonderful contest!

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

Wishing good luck to everyone :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -10 Проголосовать: не нравится

is there any penalty for wrong submission

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

"omg hi codeforces"

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

Score Distribution ?

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

I have done with bit manipulation . But I can't solve the questions related to it. Even easy questions. Even after practicing all A ans B questions. What should I do?

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

Hi

Can anyone suggest me something to reach expert

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

score distribution is interesting ...

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

There will be at most five hundred interactive problems in the round, which means all problems might be interactive. That's interesting!

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

Hope people like me who gained negative rating changes in the last round can win back.

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

Wish everyone good luck and high rating!

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

Wow, the round has official video editorials. I appreciate the effort from authors and testers.

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

Best of luck guys ✌️ See you after the contest.

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

How to become a tester?

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

Are contests rated if you don't submit any problem after registering. I couldn't submit anything because of network issues so I'm wondering if I should participate at all.

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

Absolutely love the problem statement of E, it's from one of my favorite movies!

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

due to some complicated relationship history that we couldn't fit into the statement!

this. thankyou for not writing unnecessary statements which nobody cares about

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

This round was good one

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

If i get fst in Problem D, I will die.

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

too easy C, D but hard B.

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

E is a literal bruteforce right? Just need to calculate for layers ascending for each value in that layer/floor? I got TLE 8 and suspect it's just because I didn't map the coordinates in graph to some integer value, but rather stuck with maps :P

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

I truly crave the day in which I will see actually interesting div2 starter problems which are not based solely on one basic observation and a lot of cringy implementation. This day will obviously never come, because the current trend for coordinators is, apparently, to review problems the harder they are. Whatever, at least D and E had some really cute ideas.

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

    It's funny how you say that because I found D and E quite boring. However, it does not mean that they are bad problems, I just saw similar ideas before. I think that you will continue finding A-C boring, much like I find A-E boring, because they are not in your interesting interval (c) Um_nik

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

Problem D: Link

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

I can't be the only one who misread problem A as to color the row and column and not the cell intially.

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

How to solve E? I feel like it is some sort of convex hull stuff and I'd be kind of sad if it was something much simpler...

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

    If I'm correct (TLE test 8), there are at most 2K+M vertices you need to store the value for in order to solve the problem. Simply go layer by layer (from bottom to the top) and calculate the minimum path for every vertex present in the current layer (it is either reachable by using ladders or from some of the reachable 'neighbors'). So it's just a simple DP on each layer with the complexity of O(2K+M) but there's an extra log factor needed to compress the vertices (integer pairs) into some integer form.

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

    let's say you calculated all the minimum values at which you can end up in some points after climbind some stairs until level X (i.e. you calculated $$$minhit$$$ for every cell $$$c[i] \lt = X$$$), and now you want to calculate where these values can go from this level upwards (using some ladders on level $$$X$$$). Then, we can observe that if we were to plot $$$min(abs(i — d[i]) * x[i] + minhit[i]$$$, for every $$$i$$$ with $$$c[i] = K$$$), then every $$$i$$$ (with $$$c[i] = X$$$) is assigned EXACTLY one segment on the number line (where it is a maximum value).

    After sorting each of these points by $$$d[i]$$$, we can do some stack like thinking to determine which values will actually be visible (and we by doing so the points will then be conveniently sorted again by $$$d[i]$$$). Then, we could check for each stair that begins on that level what is the cell from which it derives it's minimum (with two pointer logic).

    Time complexity: O(KlogK + N) (more or less)

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

Great Contest. Balanced. Loved problem D. Thankyou!

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

code

my approach for C:

  1. if any node has degree more than 2-> -1
  2. start dfs from leaf node and assigning edge alternate 2 and 3 as weight is this approach correct?

please point out what I did wrong

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

Can anyone explain logic behind problem C? my idea was if there exist any node connected with more than 2 edges then answer is -1 otherwise we can use 2 and 5 to assign weights in appropriate manner. i am getting WA on pretest 2. Can anyone help??

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

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

first to be the first AC in D :) cool : L

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

Multisource bfs in B ?

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

Interesting and balanced problems. Very nice round!

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

WoW, I fucked myself in this contest.

»
5 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится -64 Проголосовать: не нравится

I was tricked into submitting late by mean testcases in D and E, bad experience.

First I was annoyed by lengthy problem statements, then by myself because not commited but solved A to E anyway, then submitted and beeing annoyed because D and E where wrong.

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

Not Bad

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

Cool contest. How to solve E? I thought about Dijkstra's, but that seems too slow. I'm not sure if plain DP with memoization would work (and only visiting states in which we have an in-ladder or out-ladder)?

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

.

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

My stupid ass thought for a whole 15 min that 1 is a prime number and was trying to figure out why assigning 1 to each edge in C would not work....FML

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

Notforces!

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

What's wrong with my submission 142866521 ? I see similar logic in others submissions, there must be an implementation problem somewhere, but i cant find it.

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

    The start of your BFS function always starts at a weight of 3, so if vertex 1 is not a leaf, then both of its adjacent edges will have a weight of 3 and thus the path containing both those edges will have weight 6. You can fix this by either starting each edge with different weights or finding a leaf and BFSing from there

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

wow very fast editorial! nice

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

anyone else got mle in question 3 in system test?

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

Problem D is equal to this leetcode1819.(The problem is in Chinese)

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

Stupid Question, Ignore. :facepalm:

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

    dijkstra doesn't work for negative edges and is intended to TLE.

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

    Hello fellow same-surname, testcase 4 was an anti-Dijkstra testcase (regular Dijkstra doesn't work with negative edges).

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

      Thanks for your reply. Can you elaborate what the test case was. I do understand Djikstra won't work with negative edges but still find it hard to visualise in this instance.

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

        Here is a simple sketch I made of 1 layer of the counterexample.

        diagram of countercase

        Specifically, what is happening here is that we will processes the lower left corner with a distance of 0. After this, the next shortest is the upper left corner with a distance of -2, and then the upper right corner with a distance of 1. Finally, the lower right corner will be processed with a distance of $$$x$$$.

        There are 2 possibilities for implementations of Dijkstra that happen now. In the first one, a node is processed only if it is not marked as visited in some array. In this case, the upper right corner will have a distance of 1 marked even though the correct distance is 0.

        In another implementation of Dijkstra, a node is processed when it is at the top of the priority queue and the distance in the queue matches the distance stored in some array. In this case, the node would be processed once at a distance of 1 and then again at a distance of 0. If we make $$$x$$$ large enough and chain multiple of these layers together, then each layer will have to be processed multiple times which leads to an exponential solution.

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

      Nvm

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

Is there an actual right solution for E using graphs? I passed pretests with Bellman-Ford(Dijkstra doesn't work well with negative edge weights), but I got FST(here's my solution: Goodbye Candidate Master)

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

What are the odds that you rewatch a Bollywood classic in the evening and open a problem statement and see that is about a scene that you were watching literally minutes ago. Good choice of story :)

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

after how much time our rating will be changed?

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

As a contestant, I want to clear my contribution

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

Can someone please point out, why I am getting TLE on test 8 in problem E? I am going layer by layer and using prefix and suffix max to get the answer of a layer. According to me, this is not more than roughly $$$O(nlog(n))$$$. link to 142887592 .

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

    There are repeated rooms on floors, so you might be using multiple ladders from the same room at a floor, multiple number of times. I had the same error. Remove Duplicates from your vectors before taking pref_max suf_max.

»
5 лет назад, скрыть # |
← Rev. 4  
Проголосовать: нравится +69 Проголосовать: не нравится

Fun round! But for 1627F - Not Splitting, how did that "subarray" vs "subsequence" mix-up manage to get through all that testing and coordination?

I know the statement gave a definition of "subarray" (which matches the conventional definition of "subsequence", not "subarray"), so technically the statement was correct, but those definitions should be skippable by experienced contestants. Problems shouldn't re-define common terms.

  • »
    »
    5 лет назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится +45 Проголосовать: не нравится

    Sorry, the statement said "subsequence" during testing and coordination but during the translation (which happened a few hours before the contest), a translator decided to update the English statement to say subarray instead of subsequence and we didn't notice. Hopefully this didn't affect anyone's performance too much (and hopefully you could also tell what we meant by the image and the first sample).

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

Very nice contest, but I feel like B and D should have been swapped.

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

Thank you very much for this nice roud :))

Here are my thoughts:

A
B
C
D
E
F

But to be fair, the round was really good and I enjoyed it a lot! I hope to see more of your rounds in the future :D

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

Ratings updated preliminarily. We will remove cheaters and update the ratings again soon!

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

I think my D is hackable.

For each X, I am not considering the gcd of all the multiples of X. Instead, I am just considering the gcd of the smallest multiple of X with all other multiples of X and checking if there is any instance where gcd == X.

Do I loose my rating if somebody hacks my solution now? xD

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

I thought the round is good(Even if I just solved 3 problems during contest), but D and E is very fun.

Thank you for giving us a perfect contest. Looking forward to your future contests.

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

E had me like "Helikopter Helikopter".