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

Автор diskoteka, 3 года назад, По-английски

(っ▀¯▀)つ Heeey Codeforces (っ▀¯▀)つ

I and pavlekn are glad to invite everyone to participate in Codeforces Round 885 (Div. 2). The round will take place on Jul/16/2023 17:35 (Moscow time).

This round is dedicated to an amazingly beautiful girl Vika that I love very much. Every problem will be about her and related to her life.

The round will be rated for participants with rating lower than 2100. We will be glad to see the participants with a higher rating to take part in our round unofficially as well!

You will be given 6 problems to solve in 2 hours.

We would like to thank everyone that makes this round possible:

  1. Artyom123 for coordinating the round

  2. MikeMirzayanov for great Polygon and Codeforces platforms

  3. teraqqq, Be_dos, mibig, FairyWinx, princebelkovetz for red testing

  4. Dominater069, mbolgov, I.Gleb, induk_v_tsiane, Alexdat2000, maomao90, irkstepanov, fishy15 for yellow testing

  5. Insightful, alwyn for blue testing

  6. TkachDan, competitive__programmer for cyan testing

  7. maksimb2008 for grey testing

Scoring distribution: 500 — 1000 — 1500 — 2000 — 2250 — 2750.

We wish you all good luck and a high rating!

UPD: Editorial published

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

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

Hoping for a lovely contest.

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

Love round

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

Nice!

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

LoveForces

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

So you are saying there is hope for me :) ? Do I need to reach purple first :) ?

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

Hope the problems are lovely as well :)

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

very beautiful hearts drawn by yourself?

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

<3 Lovely <3

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

Rooting for your lovee! :)

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

This guy really love his girlfriend.

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

I hope they don't have a fight.

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

Goals

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

Can anyone please answer why suddenly round-882(div2),round-884(div1+div2),round883(div2) became unrated?I did really well at those rounds.IS it a temporary bug or anything else?

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

Hello everybody!

I would like to become a student in this competition (green). And I hope that this competition will be interesting.

Good luck to everyone!

Best, Jelal

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

If I reach purple this contest, will I also get gf?

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

I hope every problem doesnt remind me how single I am

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

Where purple and green testing?

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

Codeforces is the last place I thought I'd see PDA in.

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

Let's hope his gf is a beginner then

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

I won't participate because of cringy subject

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

what topics could be expected for A,B and C. anyone??

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

<3

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

UwU

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

no wonder it took that long to annaunce

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

if you have a social life you must not be a real cp-er

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

Finally, a round that doesn't clash with my schedule! Going for purple, good luck everyone! :)

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

Still a better love story than Alice and Bob

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

think the problems will be good (based on the last div3 rounds they writy)

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

Best way to celebrate Love and others Loneliness

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

Feels inferior to Genshin Impact :D

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

Meanwhile single people like me reading this blog ^⁠_⁠^

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

Remember guys heartbreak is the key to unlocking codeforces mastery

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

This announcement is accompanied by a beautiful picture.

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

I think today his girlfriend very happy

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

Hope to reach expert this contest.

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

Best of luck everyone, I hope everyone attempts this one with Love..

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

Contests are quite rare these days!

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

This relationship got 6 problems and we have 2 hours to solve them. Lesssgo.

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

Giving contest to increase rating NA Giving contest to know their love story Yes

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

Normal People express love through Roses and Chocolates. Legends prepare a whole Contest...

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

LoveForces...hoping to reach blue..

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

I also love ... love competitive programming. It is the only thing that understood me like a human being. #sigmagrindset

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

I can't wait to enjoy the problems.

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

I suggest you to have a grey bo'oh'o'wa'er next to you during the contest

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

Setter be like :

  • Tu Aake Dekh Le
  • Ho Maine Contest Kitne Saare
  • Teri Yaadon Mein Banaye Sohniye
  • Sohniye
»
3 года назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I hope that no issue would ever make me realize how alone I am.

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

Is there a hacking session in this round?

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

No pink testing??

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

Hope we will still love the contest after rating changes

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

Hope we will still love the contest after rating changes lol

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

"Every problem will be about her and related to her life" every relationship ever ;-;

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

The round is cool, recommend to everyone!

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

Wedding when?

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

Plz vika help him to create problem language more understandable.

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

What went wrong at F?

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

You should have proofread the statements before the contest. E and F contain silly contradictions and unclear sentences and both were edited after wasting some time trying to unravel them.

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

This contest is as unattractive as the bridge mentioned in problem B. Worst problem statements ever.

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

I really hate Vika now

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

Problem statements are very difficult to understand.

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

For me hardest Div 2 problem A ever.

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

Vika is too difficult to get vro

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

6

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

maybe problemsetter should have spent less time obsessing over vika and more time making correct tests

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

Someone get Vika a translator

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

one of the worst things about codeforces's problems which is problem statement is too long for no reasons , just keep it simple like atcoder ,we don't have time to read the entire story

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

Vika is too hard to understand bru. I can now understand your pain :(

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

Worst contest ever.

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

Problem Statements are quite difficult for me to understand.

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

(love)storyforces

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

Super math round.

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

How to solve F in 5 min?

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

Definitely not a lovely contest...

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

How to solve A?

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

    think about a chessboard: if Vika is in a black square, then she can only be reached by someone on a black square and vice versa for white. Also if there's someone on her same color they can always reach her. Colors are just the parity (i+j)%2

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

      there must be atleast two other person otherwise if there's one girl on black and vikka is also on black then she will never got caught

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

        If you think about how to chase her it's easy to drive Vika into a corner (this sounds very bad lmao).

        Like near the wall


        ...| X.V| ...| becomes ..V|//(now she can only go up until she reaches a corner) .X.| ...|

        otherwise just going towards her should do the trick

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

      Have you seen or solved a similar problem/idea before ? If yes, do you remember where or from when ? Maybe when you used to do math competitions or something ?

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

        probably yes, but i don't remember any examples. A simple observation is "if a and b are on cells of different colors they'll never meet". From this observation you can think about when Vika can escape from X if they're on the same color. And after some thinking you can understand that Vika cannot escape when there's somebody on the same color

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

How to solve C?, I guess using number theory... multiples like stuff? but couldn't get it!

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

Problem A was tricky, Little harder than B.

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

I don't like probllem E. It is very OEIS-able. Also can anyone explain why we didn't have a fixed MOD in this problem. The MOD being 100 made the implementation tougher.

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

I think Vika is his ex so now he want everybody to hate her

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

How to solve D? Do I need to use ternary search?

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

What is the approach to D?

I understand that we can ternary search for the solution on f(x), where x is in [0, k] and an integer, and represents the number of times we will increase our number first, and then spend the rest of (k-x) moves on redeeming this number.

It seems to produce correct results for the first 4 sample testcases, but fails on the 2 large ones by a marginally small amount (~1e9 off the answer of ~1e18).

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

    I made it accepted by using ternary search first, and then I padded the borders L and R by some 1000, so that it became L-1000, R+1000, somehow it got ac. But, I fear it can fst though..

  • »
    »
    3 года назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится +3 Проголосовать: не нравится
    • Ternary search only works for a function who has a single local maximum in the range you search on.
    • Let us define g(n) = The discount after adding the last digit to itself n times. We want to maximise the function f(n) = g(n) * (k - n).
    • We know that, ignoring the cases where the digit ends in zero or five, that the function g(n) increases by a constant amount 20 every time n increases by four, past a certain constant c.
    • If we perform a ternary search in the range [c, k] across all numbers such that they are ≡ r (mod 4) for each r ∈ [0, 4), then we know that f(4n+r) = (20n + b) * (-4n + (k-r)), because of what was said above.
    • This is a multiplication of two linear functions of n, so the result is a quadratic in n. Also, the leading coefficient of the quadratic is negative, so it must only have one maximum since it has an upside-down U shape.
    • This shows why it works when you ternary search over every four. When the amount that g is increasing by is no longer constant, we can no longer guarantee that the shape of the graph is nice. Below is a short and informal proof if you're interested :)
    (Dis)proof by Counter-Example
»
3 года назад, скрыть # |
← Rev. 3  
Проголосовать: нравится +11 Проголосовать: не нравится

Should I quit CP? [](https://imgur.com/a/Vx3xutf)

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

Suggest banning the authors for at least a year until they recover from Vika

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

Quite new and interesting problems, I liked this round. Also, I think my D could fst, so can someone share their approach to D?

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

nice div1 contest

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

Not able to solve A. LOL

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

What was testcase7 of D

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

How to calculate the number of steps in C?

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

How to solve C? I figured out that I need to compute the following value: "how many steps you need to do to make first element zero modulo 3", and calculate it for every $$$(a[i], b[i])$$$ pair. Is that a way to go or I'm missing smth? If that idea is ok, how to compute it fast enough?

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

    That idea is good. To compute it quickly enough, note that if x<<y, then we can compress it down quickly by observing the fact that (x, y) -> (y, y-x) -> (y-x, x) -> (x, y-2x), noting that we can reduce y by 2x in 3 moves without changing anything. You can figure out how many times to compress it down by using math, noting the difference between y-x.

    There is an edge case where it starts off as (0, 0), then this pair should not be considered at all as it will always be 0.

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

    We have a set of two numbers, {a[i], b[i]}, where each number can be greater than, less than, or equal to the other. If a[i] is less than b[i], we perform one move to transform the set into {b[i], b[i] — a[i]}. Otherwise, if a[i] is greater than or equal to b[i], we perform moves until the set becomes {b[i], a[i] % b[i]}.

    For example, consider the set {11, 3}. It undergoes the following transformations: {11, 3} -> {3, 8} -> {8, 5} -> {5, 3} -> {3, 2} -> {2, 1} -> {1, 1} -> {1, 0} -> {0, 1}

    Here, 3 (b[i]) remains in the set until the number 2 appears, which is 11 mod 3. At that point, the transformation proceeds when a[i] >= b[i] to get {b[i], a[i] % b[i]}.

    We notice a pattern in the moves: a[i] — b[i] appears after the first move, a[i] — 2 * b[i] appears after the second move, a[i] — b[i] * 3 appears after the fourth move, a[i] — b[i] * 4 appears after the fifth move, and so on. These differences follow a sequence of +2, +1, +2, +1, and so on.

    By utilizing this pattern, we can determine the number of operations it takes to transform {a[i], b[i]} into {b[i], a[i] % b[i]} efficiently, in constant time complexity (O(1)).

    Here's code: 214083155

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

Problem F seems some sort of Binary search on each bit of a[i].

for j'th bit, we will find when the bit will turn zero for all a[i], 0 <= i <= n-1 .

How did rainboy solved in just 6 minutes !!!!!

submission in just 6 minutes !!!

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

Statement of problem C was wrong + testcase for problem E was wrong. I spent 15 minutes just to figure out what was problem C asking. I think it's fair enough to make contest unrated.

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

    yeah wtf. Problem statement for C and examples are contradictory af.

    The statement says that the planks can't have different color after repaint at most once, but the example has the first and last planks of different colors then the rest. In total the girl walks over 3 different colors wtf?

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

You can end your search, you have found the dislike button for problem A ----->

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

The worst content I have seen.

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

screenshot

Am I happy for solving F or frustrated for not solving A?

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

In A problem I coudnt understand what does "adjacent to the side room" mean?

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

could have been 700 higher position if i didnt forget to put a command inside the brackets.

in C everytime one element is smaller than half of the the other element, every 3 steps the other number get decreased 2 times from the smaller number right? we count how many steps each number needs and see if they meet. once the number in array a is zero it will be zero again after 3 steps so we can see if the numbers will be zero at the same time.

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

Don't like when there are only math problems (at least A,B,C and D)

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

The A question in this game is incredibly mind-blowing, it's a spectacle like never seen before.

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

bruh what's with F

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

What a lovely contest! I am so glad that i participated in this contest!! (i will be green again)

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

How to handle both a[i] and b[i] even case in C ??

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

C was a monster this time! I hoped that at least I will solve till C, but B kept me occupied most of the time.

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

love was cruel

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

Loveforces shouldn't be Cringeforces

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

Got to see new types of problems, not based on common datastructures or techniques. Contest was harder overall, never did I see so less accepted in each question of a div2 contest xD

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

I cannot solve A lol

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

(

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

I am new here and now I am scared of cf, quit!!!!

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

This is by far the best round I've ever participated!

By the way, why the answer in E does not equal to the number of odd divivsors?

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

With problem statements like this, Vika won't understand a thing.

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

can we solve B using the Binary search??

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

I wish u to be a single

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

Problem F is well known in Latvia, a simplified version was used in 2017 for our team selection contest (https://lio.lv/arhivs/arhivs2/2017_4_d2_uzd.pdf problem "Aplis")

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

trash contest imo...hope Vika havent participated

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

Hi, I got the answer for problem C now (10 mins after contest ended). want to see if it is correct.

I am not able to see the option to test my solution (at summit code), where can I test it?

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

Does problem A remind anyone of king opposition in chess? Wish I solved it during contest.

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

No hate to authors but I would like to provide feedback regarding the contest, as I found it to be poorly organized and frustrating to participate in.

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

Today's C was amazing!

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

any clue so that no TLE, problem F 1848F - Vika and Wiki

my submission 214069066

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

Can anyone help me figure out if my idea is wrong for A? My idea was that if at least one friend is on a cell with the same color as Vika, then Vika will eventually be caught. And the color of a cell is determined through a chess-board like coloring.

Here's my submission: 214092967

Edit: I'm going to kms now

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

    Vika and her friends are in the same type of room by calculating the sum of the absolute differences in their coordinates. If this sum is even, it means Vika and her friend are in the same type of room. If the sum is odd, they are not in the same type of room.

    For example, if Vika's coordinates are (2, 2) and her friend's coordinates are (1, 2), the sum of the absolute differences is 1 + 0 = 1, which is an odd number. This means Vika and her friend are not in the same type of room.

    Based on this logic, if any of Vika's friends are in the same type of room as Vika, she cannot escape. If none of her friends are in the same type of room, she can escape.

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

    The problem is that you are answering before you read all the data. If you will remove the return in the while loop at all — all should pass

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

    You return early without reading the inputs when they start on the same square.

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

Good problems but hard.

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

A: If the parity of x+y is same as any x[i]+y[i], then Vika will be caught. Otherwise, Vika will not be caught.

B: For each color we record their positions. For a certain color t, we list all positions with this color, and add 0 to the front of the list and n+1 to the back, and calculate the distance of adjacent positions. For the largest distance D, we can add a position with color t between them to make D-> floor(D/2), ceil(D/2), and (the maximum distance — 1) will be the answer for this color. We can look for all colors and take the minimum answer.

C: If a[i]=b[i]=0, they will always be zero (and this pair can be ignored), Otherwise, they will go into some circulation like (k,k,0,k,k,0,...) with period of 3, so we can find t[i]%3 where t[i]=the number of operations to make (a[i], b[i]) into (0, k). We can find t[i]%3 recursively: For (k, k) return 2, for (k, 0) return 1, for (0, k) return 0, for (a, b) where a>=2*b solve for (a%(2*b), b) recursively (because (a, b) --> (b, a-b) --> (a-b, a-2*b) --> (a-2*b, b)), otherwise let (a, b) <-- (b, abs(a-b)), solve recursively and add 1. Thus we can solve in O(n*log(max(a, b))).

D: If s%10==0, then s will not change in the 2nd operation, so the answer is s*k. If s%10==5, then s will become s+5 after any positive number of 2nd operations, so the answer is max(s*k, (s+5)*(k-1)). Otherwise, s%10 will go into the (2 --> 4 --> 8 --> 6 --> 2) circulation, and each time of loop will make (s, k) <-- (s+20, k-4). So we can do (s, k) <-- (s+s%10, k-1) for 4 times, each time we look for the maximum value of f(t) = (s+20*t)*(k-4*t) where t>=0. (We don't need to consider the case for 4*t>k because f(t) will be negative) This value can be found using ternary search in O(log(k)), or in O(1) by setting t0=max(0, (5*k-s)/40) and check f(floor(t0)) and f(ceil(t0)).

E: The answer is the number of odd divisors of X, so we can solve the problem using prime sieve, and for each odd prime factor p, we make cnt[p]++ and ans=ans*(cnt[p]+1)/cnt[p]. But since modular number M can be small, sometimes cnt[p] will be the mutiple of M and can't be inversed. So we need to record the number of p such that cnt[p]%M==0 and process case for cnt[p]%M==M-1, cnt[p]%M==0 separately.

Explanation for the answer

F: We can solve for each bit of a[i] and take the maximum answer. Now assume a[i]<=1 and we can use bitset to store it. We can find that after 2^t operations a[i] will become a[i] xor a[i+2^t], so we can find the number of operations to make a[i]=0 by binary search, using shift operations of bitset. Thus we can solve the problem in O(n*log(n)^2*log(max(a[i]))/w). But this is hard to pass the time limit. But if we doing binary search like what we do for binary search on the fenwick tree or finding LCA by binary lifting, we can solve in O(n*log(n)*log(max(a[i]))/w).

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

what an amazing contest! (i love pupil)

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

Solved 1 problem only. But it means I'll probably learn a lot from editorial which is good.

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

Problems A, B, C and D were all non-fun to solve. Problem statements were so unnecessary long. Problem D isn't even CP problem it's just math. Vika will never love you.

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

I could not wrap my head around A (gonna be cyan now lol). I also think C was a beautiful problem requiring many interesting insights even though I didn't solve it in contest.

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

    +1 gonna be cyan as well)

    Can't agree, that C was a good CP problem, D was much-much-much easier and CP-alike. I figured out the solution for D after reading statement for the 1st time, but after 1h 40m spent on A+C, so couldn't implement it in time...

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

I didn't get purple because I forgot to use doubles for D to calculate (k — s / 5) / 2. sad T-T

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

chill guys don't downvote, we just not good enough to solve the problems

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

Only 8k solve in A?? Keep in mind that 25k registered for the contest

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

did anyone else solve F with SOS-DP?

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

Bad Problem Statement and unbalanced round

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

I saw a variation of A when practising for the Facebook Hacker Cup once, and that's probably the only reason I solved it so quickly :)

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

worst contest

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

what's up with people hating on A? it's just parity check right? The parity for (x+y) changes everytime, and friends can always try to come near Vika so it all comes down to is there a cell that has the same parity from original position between Vika and at least one of the friend

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

    Oh, then prove it. Always comes close by what sense?

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

      the distance between Vika and a friend is always non increasing, and since the board is finite it must eventually decrease

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

        given distance always non increasing and board is finite
        it must eventually decrease

        No, it could just not increase without decreasing, aka stay equal, at least given only your two observations.

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

          um ok. more specifically, if Vika wishes for the distance to never decrease, then she must move away from the friend on each move. this is because the friend will always move one square closer each turn. this limits Vika to the same subset of moves for all of her turns, so eventually she will not be able to make a move without decreasing the distance. note that except for a single exception on the first move, it is not possible for two opposite direction moves to both increase the total distance, so this is true.

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

      imagine the board has only 2 people. Because the board is limited, one person can always chase toward the other on at least one of the dimension.

      Like if A tries to runaway on X dimension, B can always follow A until A has to turn around or stop on that dimension, then B advances one more position toward A on X. Keep repeating that until they meet.

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

      Let's check Vika's possible moves:

      1. If she moves towards her friend, her friend will also move towards her and the (manhattan)distance between them decreases by 2.

      2. If she moves away, her friend will do the same move and she will be closer to catching Vika because she can't run indefinitely, she will hit the walls then the corners(and then not be able to move away).

      Note: Towards means that the area of the bounding box containing both Vika and her friend will decrease. Moving away means the area will increase.

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

    It's not a bad problem, but it can be really frustrating if you don't have that intuition. It shouldn't be on a Div2A.

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

Vika better not read those comments or she'll start packing her bags!

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

For problem E, my submission works even when $$$M$$$ is not prime. We need to find the number of odd prime factors of $$$x$$$. So we can keep dividing $$$x$$$ by $$$2$$$ until $$$x$$$ becomes odd. Now we assume that $$$x$$$ is odd. Basically we not need to find $$$(y_1+1) \cdot (y_2+1) \cdot (y_3+1) \ldots (y_k+1)$$$ % $$$M$$$ where $$$x={p_1} ^ {y_1} \cdot {p_2} ^ {y_2} \cdot {p_3} ^ {y_3} \ldots \cdot {p_k}^{y_k}$$$, and $$$p_1, p_2, \ldots p_k$$$ are distinct prime factors of current $$$x$$$.

So we can have an array $$$A$$$ of length $$$MAX(MAX=10^6)$$$ such that $$$A_i = 1 + $$$ exponent of $$$i$$$ in the prime factorisation of $$$x$$$. Note that $$$A_i = 1$$$ if $$$i$$$ is not prime. After $$$i-$$$th update, we need to change the values of $$$A_{q_1}, A_{q_2}, \ldots A_{q_z}$$$ where $$$q_1, q_2, \ldots q_z$$$ are prime factors of $$$x_i$$$. After changing all the required values, we need to find the product of all elements. These operations can be performed easily with a segment tree.

If $$$x$$$ contains a prime factor larger than $$$MAX$$$, its exponent will never change. So, we can take care of that separately.

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

When you planned to solve 5 and end up solving just 1: Pain,
codeforces please drop me to pupil. I want to give div 4

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

stop using google translate

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

Problem E is absolute DOG SHIT, imagine a problem-setter who can't come up with original ideas so he decided to adopt a Div2-C problem and then mess with the modulo. Next time, try to be less creative!

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

Mathforces!

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

How to solve D?

I could think of a ternary search solution, but seems like something is missing...

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

Shit problem statements round

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

The author for 6 problems could not ask Vika to marry. Why was this contest needed at all? :)

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

This is a troll round, the contest was intentionally bad as Vika is probably the girl that the author hates.

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

M should've been made much bigger in Problem E (bigger than $$$O(Q \log x)$$$) — it looks like the authors weren't aware of the edge case when M is too small and the power of an odd prime in the factorization reaches M (ie you can't simply multiply the answer by (power + 1) * inv(power)).

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

can problem B be done with binary search?

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

Can you reduce your nonsense when setting questions?

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

they should have added atleast one picture in problem A.(T_T)

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

Imagine being forced to do math :sob:

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

Anyone notice D is so fucking tedious and can be done by solving an inequality to solve for number of cycle for each digit the bonus could ended up at ?

Someone can just use chatgpt to solve for generic inequality for D lmao

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

    how is it tedious? What was your inequality?

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

      generating all digit beginning from 0 to 9. There is a cycle among all of them. Each cycle adds to the bonus a value of 20. You can verify this by generating and print. The only exception is 0.

      Now starting from the original X, repeat this until the unit digit of X' has been seen before

      assuming the current digit is the terminal digit, And let's call left is the number of moves left. Then we have if we stop here then discount is X * left. Otherwise we got (X + 20 * c) * (left — c) >= X * left. c is the number of cycles we will repeat * length of cycle. -> X * (left — c) + 20*c *(left-c) > X*left

      Then solve for c.

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

SimpForces

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

I'm so disappointed with this trash round.

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

Authors forgot to prepare A problem

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

Hello DifficultForces!

I used another account to participate in this contest. I solved 3 problems in total, and got a performance of 1830. One of my friends also solved 3 problems with less penalty, and his performance was evaluated as 2026. Only 60 persons passed A after the first 4 minutes, are you serious?

And F is wonderfully easier than E, what's your explanation for this?

In summary, I think this is a div1.5 round, not a normal div2 round. It's even worse than any of the cn rounds held before.

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

you feel that the problem is not difficult enough and decide to add confusing sentences -_-

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

Why this contest sounds like an atcoder contest

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

Raise your hand if you also tried to solve B problem using Binary Search ┐⁠(⁠ ⁠˘⁠_⁠˘⁠)⁠┌

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

Could someone please help me out with what i am doing wrong in C Link

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

C problem is very strange

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

Horrible contest.

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

I got +73 points in this contest and my level has reached the Master level for the first time. that's cool

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

Maybe the contest is not good enough, but don't feel sad, and sincerely hope that you and your crush can fall in love forever.

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

Love and coding can't go hand in hand. Hence proved by today's contest. Love was so cruel. Took more than 1hr to solve just A. Love is war.

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

Story Behind DIV2A:
Once upon a time, our protagonist Vika found herself in a bustling mall, having a grand ol' time with her friends. But lo and behold, who did she spot but the infamous diskoteka tailing her! Fearing his presence, Vika hatched a plan to escape the clutches of this relentless pursuer.

However, much to her amusement, diskoteka misinterpreted her actions. The dim-witted diskoteka thought Vika was trying to ditch her friends and decided to be the self-proclaimed hero by aiding her in her "escape." And so, he hatched a devious scheme — he concocted a DIV2A problem that was devilishly tricky yet hilariously described.

In this DIV2A problem, diskoteka portrayed a perplexing puzzle with his comically bad statement-writing skills. It was a conundrum so confusing that even the most skilled programmers would scratch their heads in bewilderment.

With a smile on her face, Vika couldn't help but chuckle at the absurdity of it all. Little did diskoteka know, his attempt at being helpful had turned into a laughter-inducing escapade.

And so, with the mall shenanigans and the DIV2A hilarity, Vika and her friends continued their joyous hangout while diskoteka remained blissfully unaware of his unwitting comedic performance. Ah, the adventures that unfold in the most unexpected ways!

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

Кому понравился этот дивизион?

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

Mathforces?

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

I think C is not so easy and D is not so hard. If C = D = 1750 or 2000, the contest were much better.

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

Did not know love was equivalent to maths.

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

People have already pointed out many of the same issues over and over again, so I would like to give the round some compliments :)

Honestly, a majority of the issues people had with the round seem like they would be fixed with just more testers, rather than the problem quality being terrible (like the lengthy statements, errors in test cases, etc).

Personally, I found all the problems enjoyable; in particular, I liked C and F a lot :). To the authors, thank you for the contest! And please, continue problemsetting! I have enjoyed the problems from all of your recent rounds.

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

Vika is a mathematician :)

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

Hello, diskoteka, although I dropped points in this contests, but I saw that you really love Vika, the story are all about her lives and I can see the depth of your feelings between the lines, and here's wishing you and Vika forever!

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

First problem is very interesting and unusual, thanks!

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

I feel for Vika, listening to boring meaningless fashion talks must be really painful. I wish her to find better friends, with whom she could enjoy fun and exciting conversations about strings, arrays, stacks and graphs, so that she doesn't need to hide from them anymore.

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

Hateforces (:

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

.

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

I never knew the meaning of the word penultimate. After this contest, I learnt the meaning of this word. Thanks.

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

2099->2204^_^finally

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

C : Nie prblm