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

Автор PvPro, история, 11 месяцев назад, По-русски

Привет, Codeforces!

Мы рады пригласить Вас на Codeforces Round 1026 (Div. 2), который состоится May/24/2025 17:35 (Moscow time). Этот раунд будет рейтинговым для всех участников с рейтингом меньше 2100. У вас будет 2 часа для решения 6 задач. Задачи были подготовлены XaRDKoDblCH и PvPro.

Мы хотели бы поблагодарить всех, кто сделал этот раунд возможным:

Разбалловка: 500 — 750 — 1500 — 2000 — 2250 — 3000

Наш раунд будет посвящен cyberpunk-тематике, поэтому приготовьтесь спасать мир от роботов! ;)

Удачи!

UPD: Контест закончился, поздравляем победителей!

среди всех участников:

  1. maspy

  2. Geothermal

  3. 9ovem

  4. peti1234

  5. turmax

среди div.2 участников:

  1. 9ovem

  2. still_still_stellar

  3. Hellia

  4. Badint

  5. cuongaaaa

UPD: Разбор

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

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

Автокомментарий: текст был обновлен пользователем PvPro (предыдущая версия, новая версия, сравнить).

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

Автокомментарий: текст был обновлен пользователем PvPro (предыдущая версия, новая версия, сравнить).

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

So excited for Cyberpunk round and hope to get CM :D

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

As a tester, I confirm that problems are set in 2077. Hope you enjoy them!

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

Hoping that the problems will be easy.)

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

If theres a 2000 point problem, it should be increased to 2077 :D

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

Excited for my first contest :]

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

Hope that the streak of getting negative deltas breaks with this Cyberpunk contest and bring me big positive delta.

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

round will be rated for all participants with a rating below 2100? So if one's rating is 2100+ he can't get rating or something?

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

Down the line I hope codeforces round 2077 is written by you guys too

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

Let's hope that this round will be post patch 2.0 cyberpunk like :D

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

Im sure, My laptop cannot handle Cyberpunk!

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

Hope to improve my rating :P

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

And now you're going to leave with nothing but a sign? :(

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

wish my result gotta be the game NOW and not when it first came out. Gl to everybody tho

orz

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

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

will the warrior race get a positive delta??

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

will skip LeetCode Biweekly(35 leetcoins loss) for cyberpunk theme, lessgooo.... Hoping for gr8 contest and editorial too.

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

Hopefully, the problem statement will be short and precise just like the announcement!

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

Hope for not doing the Hat-trick of negative rating dealt by getting a positive rating dealt.....

#pray_for_me

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

про ваш раунд нексюша песню написала???

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

Competing under the handle "bartm0ss", I’m honored to join this cyberpunk contest :D

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

Competing under the handle bartm0ss, I’m honored to join this cyberpunk contest :D

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

As a Cyberpunk 2077 fan, I am really excited for this

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

excited for this!

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

Lmao I am literally playing Cyberpunk currently

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

Hoping for a positive delta.

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

Hoping to get to pupil in this one :).

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

why previous contest rating is not showing on profile. Anyone with same problem??

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

Let's goooooooooooooooooo

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

Just want to wish luck and enjoyment to everyone!

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

So excited for the cyberpunk theme!! Hope everyone performs well.

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

Damn, a true CP contest.

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

this photo is interesting

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

hope you all get positive delta this time for saving the world and me too!!

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

where is scores?

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

where is scores?

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

Why is it clashing with LC biweekly :(

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

    Let l1 be the start time of the LC biweekly contest, and r1 be the ending time for the same, let l2 be the start time of the CF round 1026, and r2 be the ending time for the same. Now because l1<l2<r1<r2, there's a clash, Ok ?!

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

score distribution??

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

I am gonna play Cyberpunk soundtrack while solving hehe

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

We got Codeforces 2077 before GTA 6 !!!

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

when have contest have T-shirt

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

Wish me luck guys so that I can hit Pupil today <3

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

希望能解出4道题:)

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

my current rating is 839 . how many questions i have to solve in contest to reach 1200 rating.

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

Yeah I'm * out of competition

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

Why Rust is not allowed?

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

Gains don't stop!!!

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

What could be the difficulty rane of problem C?

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

What could be the difficulty range of problem C?

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

Today's sponsor: "All right, David. Let's go. To the top, then"

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

Блин. А че делать если не играл в Киберпунк2033

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

    Пиши !комп в коментариях и получи возможность получить великолепный компьютер, который потянет данную игру на максимальных настройках!

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

      ... Простите товарищ, но мне моего ноутбука core i5 который способен потянуть от Doom'а до Gta V будет достаточно.

      А про КиберПунк... К счастью есть такой ютубер Нарратор... По бырику все объяснит.

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

I love Cyberpunk 2077, one of the best stories in gaming in my opinion. Good luck to everyone who's participating :)

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

My First contest, lessgoooo

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

Almost the same as problem C was given this year at ONI (romanian informatics olympiad) link

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

Good contest, Thank you

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

Good contest, thank you

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

TOO CLASSIC D

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

for the first time i did Answer construction on a greedy problem.

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

I could not solve C :( . Let's see how much rating goes down

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

I hate C. How hard was it to find the d values :(

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

Why is it failed system tests on A for everyone? UPD: It's OK now

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

Problem F was very nice imo.

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

I enjoyed problems C and D .. I found them challenging and I was a little slow in solving these problems ..

also very happy to not make a silly WA submission for problem B .. lolzzz

Thanks for the nice problems..

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

    wtf was c? i tried maitaining a queue, set all -1s to 0 initially and when its required to flip the 0s to 1s (h curr < l[i]), then i pop the indices in my queue and set them to 1. ig the only problem here is that when i set the values to 1, the range between [popped index, current i]'s h values will all increase by 1, which may cause it to cross r[i], which could be probably be checked by tracking each h[i]'s, and then applying the +1 to this range using that weird prefix sum trick. but i was too lazy to do that but anyway, is there any other approach? soo many people solved c idk how is it a standard problem ?

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

      oh so I did exactly same kind of thing.. but I did one extra round in the end to check if all the h[i]s are still in l to r range.. that passed protests for me.

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

        I did it slightly differently, firstly i changed the original li,ri array, by decreasing each entry by number of 1s appeared before them, if at any place r1 went below 0 that was an obvious -1 as ans. then i created a suffix array where each entry was min of ri's appearing from i to nth pos. this gave me an idea on when i encountered d=-1 while traversing from left to right if curr height is less than the value at i pos in suffix array, then I can make d=1 otherwise make d=0. if ant any pos our curr height isnt b/w the given li ri, then report ans as -1

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

        i guess im just lazy lol

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

E is cool. I couldn't code it in time, but I think it's cool.

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

Problem E appeared in last year's TAP (Argentinian Programming Tournament) Problem

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

hello, i found a hack testcase for my solution on problem D, but i couldn't figure out how to hack my own solution, any help on how to hack it?

edit: the incorrect solution still passes main tests.

edit2:

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

Problem E was interesting, but I didn't learn how to find Euler path :(

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

Can someone tell me why my solution of problem D fails?

I used Binary Search + Dijsktra

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

    Use long long , also upper bound of bs is atleast sum of weights

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

      I'd be so disappointed if that was the case :(

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

        That's actually wrong, the upper bound is not sum of weights, it's the maximum weight of a path (so 1e9 + C works). Though, Dijkstra is on the critical performance line and would probably not pass. You should use DFS since you have a DAG.

        Looking at the solution I don't see any blatant mistakes, though i didn't check that dijkstra and bs are written correctly but I assume they are

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

        Ah, yeah, I think I've figured it out.

        In each check(), you want to find not the shortest, but the longest path. Otherwise, you risk being in a situation where you've already skipped a node but could not go through a certain edge as it costs more batteries than you've already gained. Dijkstra can't find longest paths.

        Example test case: 1 6 6 3 1 2 10 0 0 1 2 1 1 3 2 2 4 1 3 5 1 4 5 4 5 6 13

        In this case, the correct path is to go 1 -> 2 -> 4 -> 5 -> 6 because you need to pick up the 10 batteries at point 4, but your algorithm only considers 1 -> 3 -> 5 -> 6 because of the ordering. Hence, your answer is -1 and the correct answer is 13.

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

I found F very satisfying to solve. When I first saw it, I thought there was a good chance it would end up being bashy and/or involving lots of technical details, so I was pleasantly surprised to find that it just involved a couple of nice observations. Thanks for the round!

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

Nice contest, no ambiguous statement like other contests..Thank you..

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

good contest

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

What is the solution to C?

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

Why my F solution 321144387 got WA on 3?

The idea is:

f(x,y) is always less(or equal) than 2*min(x,y) and max(x,y).

So if we have a pair of numbers (x,y) which satisfy min(x,y)*2>max(x,y), then f(x,y) will equal to max(x,y) and we can ignore all the numbers less than max(x,y).

Thus, we can maintain a set, which don't have a single pair satisfy min(x,y)*2>max(x,y) in it, and each time we add a new number x into it, check if there have a number satisfy the condition mentioned above.

We get answer from the max of two parts: the maximum max(x,y) which satisfy min(x,y)*2>max(x,y) and maximum f(new element, numbers in set).

It can be shown that the number of the elemnts in the set always less than $$$\log 10^9$$$.

Sorry for my bad english :(

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

My F solution:

Consider sorted $$$a$$$ (non-decreasing order), and remove duplicate numbers:

for each $$$a_i$$$:

  • if $$$a_i \lt 2a_{i-1}$$$, $$$\max(f(a_i,a[1,\ldots,i-1]))=a_i$$$, easy;

  • if $$$a_i \ge 2a_{i-1}$$$, bruteforce $$$O(logA)$$$ such numbers.

I think it's absolutely correct, but I don't know how to TLE in #8.

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

    I think your code brute forces every time there's a new maximum? If a[i] is the new highest number in the set, then it == S.end() will be true, and a[i] > lstans will also be true because the max number in the set so far is an upper bound on the answer.

    I'm not sure what the purpose of the a[i] >= 2*(*it) condition is, since I think this will never be satisfied (because *it will always be at least a[i]). Maybe you meant to define it as the greatest number less than or equal to a[i] rather than the smallest number greater than or equal to a[i]?

    You might realize this already, but it's worth noting that you only need to do the brute force step in cases where the new element you're adding is a new maximum (and is more than double the existing maximum). This is because we can prove that the best answer always includes the maximum element of the array. I'm not sure if handling this incorrectly actually worsens the time complexity (I think checking that the new element is greater than the last answer may be sufficient to achieve $$$n \log a_i$$$), but I think noticing this makes the solution a bit easier to think about.

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

      Hi, thank you for your reply. I'd like to explain my algorithm during the contest 321142583.

      I defined set<ll, greater<ll>> S, so S.lower_bound(a[i]) is actually looking for the largest number smaller than a[i].

      I didn't observe that the optimal answer must include max_a, but I noticed a similar conclusion: f(a[i], a[j]) >= min(a[i], a[j]).

      This was my motivation for the following operation: if a[i] >= 2 * S.lower_bound(a[i]) and a[i] > lstans, add a[i] to vsp.

      My analysis of the size of vsp is: if a[i] is not the current maximum or second maximum, a[i] > lst_ans cannot hold (according to f(a[i], a[j]) >= min(a[i], a[j])). Therefore, a[i] must be the maximum or second maximum to satisfy a[i] > lstans. Additionally, due to the other condition a[i] >= 2 * S.lower_bound(a[i]), a[i] causes the current maximum or second maximum to at least double. Thus, the size of vsp should be $$$O(\log A)$$$.

      Overall, I believe my algorithm is $$$O(n \log A)$$$.

      But sadly, based on my further testing (321273462), even only if you use a set, it results in TLE. You can see that even when vsp.size() <= 2, the code still gives TLE. I suspect this is because the constant factor for a set with $$$10^6$$$ elements is too large.

      Although I didn't achieve AC in the contest, I still learned something: having a correct idea is not enough—you also need to optimize the implementation to reduce the constant factor. Regardless, thank you for your patient replies and for reading my code.

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

Completed the full set today. I guess that's the first time for me during the contest time. Feels good :)

Problemset felt a bit more ICPC-style than usual, which is a good thing both for my performance and my impression of the problems. E seems like a kind of classic problem (even though the topic itself is not that popular so I liked it anyway!).

Thanks for the contest, I needed this morale boost after several poor performances last weeks.

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

    Could you please explain your approach and what classical problem you used to solve it?

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

      Build a bipartie graph, the left side represents the volume and the right side represents the pitch. Each node in the original problem could turn into an edge in this graph. The problem turn into finding an Eulerian path from the bipartie graph we built.

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

        wouldn't this be n^2 if we build vertex for every n

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

          What do you mean by building vertex for every n?

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

          The vertices are the unique values of volume and pitch; there can be up to $$$n$$$ of each of these (i.e., there can be up to $$$n$$$ unique volumes in the input). The $$$n$$$ pairs in the input are the edges, not the vertices.

          I suspect you might be imagining a graph where the $$$n$$$ input pairs are vertices and we draw an edge between any two pairs that share the same volume or pitch. This would indeed take $$$O(n^2)$$$ time to construct, and it also wouldn't lead to the solution's result that an Eulerian path in our graph is equivalent to a construction solving the problem.

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

        Wow! Thats a really beautiful trick. Thanks a lot.

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

        Just to add a bit, even though some might just instantly remember this trick, I didn't, and here was my thought process:

        • I need some sort of connections from one $$$(x, y)$$$ to $$$(x', y')$$$, and I need to be able to create a sort of hamiltonian path
        • I say "sort of", because I need to alternate movements horizontally and vertically
        • Let's just duplicate each vertex so the state "i just did horizontal move" and "i just did vertical move" are separated
        • I now add states like $$$(x, *, H)$$$ and $$$(*, y, W)$$$ — a point and the last move direction.
        • I put asterisk because it is an important notice: when you do a move on constant x, you can go from any $$$y$$$ to any $$$y'$$$.
        • So now I can do something like $$$(x, *, H) \to (x, y) \to (*, y, W) \to (x', y) \to (x', *, H) \to \ldots$$$, and I want to find sort of Hamiltonian path covering all $$$(x, y)$$$.
        • Hamiltonian path is too expensive to find, so tweak the graph a bit to make Euler paths. From the sequence above it's more or less clear that the $$$(x, y)$$$ should be the edge between $$$(x, *)$$$ and $$$(*, y)$$$.

        When I said it's a classical one, I meant that all of this process felt familiar and clicked really quickly for me. I believe some similar problems were already found in the comments.

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

How did you guys do the C question? I

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

I think E is easier than D ngl (even though I didn't solve it)

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

tfw solve C rank catapults from 3,000 -> 1,200

Solve D rank goes a measly 1,200 -> 1,000

Glad i reclaimed expert :)

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

Can dijkstra passed D? I agree BS + bfs/dp is more logical but can anyone hack dijkstra submission? For example 321138356

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

What is the idea behind E?

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

What's the point of the announcement in problem D?

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

The problem E in this contest has appeared in an ZhengRuiOI contest, and lots of people have seen it.

The solution of the that problem can solve E easily.

@MikeMirzayanov

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

what is the approach for C? i Tried maintaining a suffix minimum of R boundary, and greedily converted -1 to +1 if my cur height<= smallest R afterwards. What is the logical flaw? and can someone pls provide a test case where my code fails https://mirror.codeforces.com/contest/2110/submission/321143380. Thank you

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

Today's C why it fails?

I’m trying to keep curr (the current value) as low as possible. Whenever a jump is needed, I reduce the remaining allowed jumps by the amount of the jump. If curr becomes equal to the right end (R) of the current [L, R] range, I reset the remaining jumps to 0.

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

Hey everyone. I've participated in programming contests very long time ago. Please update me on time restrictions. 1 second is how many arithmetic operations on C++ approximately?

Long time ago it was ~100.000.000. Is it the same now, or judge processors are much faster?

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

This is crazy!!! I didn't even come up with such a simple F during the competition!

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

I wish the contest running 30 minutes more :(. I just need more proves to solve F :(

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

.

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

XaRDKoDblCH , PvPro , N_z__ , BurnedChicken , triple__a , makrav , Noobish_Monk , mainyutin , k1r1t0 , Nil2007

Weak testcases in problem D, my solution gets accepted, but it's absolutely TLE

submission: 321103308

The code that generates TLE test :

#include<bits/stdc++.h>
using namespace std;
#define AhmedPlusPlus ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

signed main() {
/* ^^^ */    AhmedPlusPlus    /* ^^^ */

//    ->> practice makes perfect

    int n = 100000 ; // starting from n = 50 it get's TLE
    vector<tuple<int,int,int>>v;
    for (int i=1;i<=n-2;i++){
        v.push_back({i,i+1,1});
        v.push_back({i,i+1,2});
    }
    v.push_back({n-1,n,1e9});
    cout << 1 << '\n';
    cout << n << ' ' << v.size() << '\n';
    cout << 2 << ' ';
    for(int i =2;i<=n;i++) {
        cout << 0 ;
        if (i != n)
            cout << ' ';
    }
    cout << '\n';

    for (auto [f,s,t]:v)cout << f << ' ' << s << ' ' << t << '\n';


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

Why are there so many greys in top 200??

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

I attempted 3 questions and got all wrong how much my rating will decrease my current rating is 874 and today I submitted 10 wrong solution .

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

Can someone give me testcase or explain me why my solution for C fails. 321130328

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

Hello I tried to solve problem D but I got tle on test 31.My debug skills are not good enough and maybe my logic is slow I am not completely sure about that. https://mirror.codeforces.com/contest/2110/submission/321157674

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

The 3rd question's test cases may have multiple answers like there is this this test case 1 -1 0 1 The flight program for this can be both 0 or 1 as both of them give valid ranges. Kindly take a look into this.

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

Why so tight constraints in F? Which solution are we trying to kill?

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

    i still dont know the model solution but basically after I figured out $$$f(x, y) \le 2 * min(x, y)$$$ I started filtering out all small elements and bruteforcing only on elements in the window $$$[\frac{ans}{2}, \inf)$$$. If too many, you take only top-$$$K$$$ (probably top-K max and top-K min in the window should work). With high enough K you might pass, so you need a big $$$n$$$ to punish big value of K.

    BTW, after that the full is just to do a full recalc each time $$$a_i$$$ is bigger than twice the current ans. But that's not easy to notice and one might try to just bruteforce more. Hence the constraints. 321166762

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

    I don’t think the constraints are unreasonably tight; your solution just doesn’t use fast IO, which makes it 1.5s slower than it otherwise would be. Adding one line to your first TLE submission makes it AC in less than 2/3 of the time limit. Submission link here.

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

So good contest i solved I hope to repeate this contest again it's perfect

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

Can someone please explain why my weird solution, which is based on Dijkstra, is working in problem D?

Submission Link: https://mirror.codeforces.com/contest/2110/submission/321131888

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

Can someone explain why my weird solution, which is based on Dijkstra, is working on problem D. According to me, it should give TLE.

Submission Link:

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

Why do some people at the top have their solution skipped on problem E? Wouldn't entire contest be skipped if you cheated?

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

actually it is a great competition, and its my first contest. I really enjoyed a lot.........

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

321336296

can someone help me find what is wrong with this it is failing some hidden test case of problem 2110D - Fewer Batteries

if anyone solved it in last contest

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

Hi @MikeMirzayanov MikeMirzayanov, I have an issue with my submission being marked as "Skipped" due to suspected plagiarism. I’ve sent you a message with my full explanation and supporting evidence. Could you please take a look at Submission ID: 321097298 from Codeforces Round 1026 (Div. 2), Problem E?

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

I`m just writing something

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

sir i havn't share my code with anyone for C [standings:6200][user:vineetagarwal1604][submission:321134211][problem:2110C][contest:1026] ques of this contest please check again i have solve by my own

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

    I kindly ask @MikeMirzayanov and the Codeforces team to reconsider this case. Thank you for your time and attention.

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

      I want to clarify that I did not copy code from anyone, nor did I share my code with anyone during the contest. I wrote my solution independently. If any code appears similar to mine, I believe it's purely coincidental or due to common approaches for this type of problem. I respectfully request that you review this case manually. I am happy to provide any additional explanation or context about my code if needed. Please let me know if there's anything further I can do to assist with the review.

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

I’m writing this message in response to the plagiarism flag on my submission for problem 2110F (submission ID: 321143062). I understand the seriousness of this situation and want to clarify my position with complete honesty. I developed my solution independently during the contest. My idea was based on maintaining the maximum value in the prefix and checking, for each new element, the best possible pair (using f(x, y) = x % y + y % x) to update the current beauty. When necessary, I looped through the history to find better options. This logic came to me naturally while solving the problem on my own during the contest. After the contest ended, I pushed my solution to GitHub, as confirmed by the timestamp in this commit: https://github.com/samuka7abr/Competitive-Programming/commit/340d6eae8cc579f07f2e1f0b0e252a131254e812 I reviewed the other submissions mentioned in the system message and noticed that many of them are nearly identical, with the same variable names, structure, and even comments. My code, on the other hand, is written in Portuguese and was entirely written by me. I did not share my code, nor did I have access to anyone else’s. This situation is very upsetting because I genuinely care about solving problems by myself it’s how I’ve been learning, both for college and for training in competitive programming. I kindly ask MikeMirzayanov and the Codeforces team to reconsider this case. Thank you for your time and attention.

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

Hello Codeforces Team,

I am writing in response to the plagiarism warning regarding my submission 321136801 for problem 2110F. I would like to clarify that I developed my solution independently during the contest and did not copy code from any other participant.

The core logic of my solution—particularly the use of prior values to compute expressions involving modulo and comparisons like x + (last % x) or y + (x % y)—is inspired by an idea I encountered earlier in a public problem on AtCoder, the ARC075 problem "Widespread" (This is the link to the problem) which employs a similar pattern of greedy sequential processing and modulo-based comparisons across an array. It also has a blog on it which I read. https://medium.com/spidernitt/increasing-by-modulo-c057eadfa1f0

My approach was based on the general strategy of using previously seen values to optimise over an expression involving modulo operations—a technique I thought independently. I have certainly used some help from auto correct editors to correct my code, but I haven't taken any other help apart from that.

I understand and fully respect the Codeforces rules. I can explain the logic of the code on my own. I promise to be careful next time. If additional information or clarification is needed, I would be happy to provide it.

Thank you for your time and consideration.

Sincerely,

ArihantSatpathy

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

In contest Codeforces Round 1026 (Div. 2), I was testing my code and there was a sudden problem with my VScode during the contest and so, I went online and I started coding there. The code must have leaked from there. I am terribly sorry for my mistake. i must have used the editor in public mode. Please forgive me. Please dont change my ratings.

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

I am writing this to apologize for my actions in the contest. I recently got a message that my code is code in problem C is found co incident with someone else code who I don't even know. Actually I got that code online and under pressure when I could not solve that problem in the last minute I Submitted that code. I am really sorry for my actions and I assure you nothing like this will happen again. Please don't ban my Id and please keep my rating changes.

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

I got skipped in the contest even though I didn’t copy from anyone or share my code. My solution matched with only a few others, but I wrote it completely on my own. It’s really frustrating to be treated like I cheated when I didn’t. I hope this can be looked into more fairly. Got skipped due to problem D in this contest

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

    Hi Community,

    So i am here to explain my intuition for problem D

    So, here is how i understood the problem: the robot starts at checkpoint 1 with no batteries and has to reach the last checkpoint. It can pick up and recharge batteries at each checkpoint, but to use a path, it needs to have a certain number of charged batteries. i realized that if i assume a certain battery capacity and simulate the journey, we can check if it’s possible to reach the end. Since having more batteries only makes it easier, i can use binary search to find the smallest capacity that still lets the robot complete the path. And if no capacity works, then it is impossible, so return -1.

    i practice this similar pattern question on youtube dsa binary search courses according to me it is pretty standard question for a dsa practice. i am new to cf becuase i only focused on leetcode , codechef and kaggle this is the first time i experienced this

    Hope so my reason can be taken into consideration for rechck

    --Thanks

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

I recently received a message regarding my solution to problem 2110C (submission ID: 321078409), stating that it significantly coincides with a submission from user proproton. As a result, my account has been banned for an alleged rule violation (writing this post from another account; my actual handle is shshank_10). I want to clarify that I did not copy code from anyone, nor did I share my code with anyone during the contest. I wrote my solution independently. I also did not use any public sharing platform like Ideone with public visibility. If any code appears similar to mine, I believe it's purely coincidental or due to common approaches for this type of problem. I respectfully request that you review this case manually. I am happy to provide any additional explanation or context about my code if needed. Please let me know if there's anything further I can do to assist with the review.

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

Hello,

I recently received a message stating that my solution for problem 2110C (submission ID: https://mirror.codeforces.com/contest/2110/submission/321114862) significantly coincides with another user's code (submission ID: https://mirror.codeforces.com/contest/2110/submission/321128925).

I want to clarify that I did not intentionally share or copy any code during the contest. This is my first time encountering such an issue, and I fully respect the Codeforces rules. It’s possible this happened due to unintentional similarity or a code leak that I wasn’t aware of.

Additionally, I would like to point out that my solution was submitted before the other user’s submission. I believe this reflects my credibility in the situation and hope it is taken into consideration.

I kindly request a lenient review of this case. I’m happy to provide any clarification or additional details if needed. Thank you for your time and understanding.

— parteekoncode

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

    Hello again, I wanted to clarify how I approached and solved problem 2110C during the contest:

    My thought process: I realized I needed to track the number of 1s and the valid range of values at each index, so I used two variables, c and d, for this. While scanning the array, I updated them as: c = max(c, L[i]), d = min(d, R[i]), where L[i] = v[i].first and R[i] = v[i].second. If at any point c > d, the configuration would be invalid, so I printed -1.

    Then, I used a set to store positions with -1 and treated it like a stack to assign values greedily—this approach came to me during the contest.

    Additionally, I submitted my solution 24 minutes before the other user, which I believe supports my credibility. I also have no prior history of any plagiarism warnings.

    Thank you for taking the time to review this. — parteekoncode

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

l

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

I got skipped in the contest even though I didn’t copy from anyone or share my code. My solution matched with only a few others, but I wrote it completely on my own. It’s really frustrating to be treated like I cheated when I didn’t. I hope this can be looked into more fairly. Got skipped due to problem D in this contest

So i am here to explain my intuition for problem D

So, here is how i understood the problem: the robot starts at checkpoint 1 with no batteries and has to reach the last checkpoint. It can pick up and recharge batteries at each checkpoint, but to use a path, it needs to have a certain number of charged batteries. i realized that if i assume a certain battery capacity and simulate the journey, we can check if it’s possible to reach the end. Since having more batteries only makes it easier, i can use binary search to find the smallest capacity that still lets the robot complete the path. And if no capacity works, then it is impossible, so return -1.

i practice this similar pattern question on youtube dsa binary search courses according to me it is pretty standard question for a dsa practice. i am new to cf becuase i only focused on leetcode , codechef and kaggle this is the first time i experienced this

Hope so my reason can be taken into consideration for recheck Matching of my code is complete coincident please review the verdict

--Thanks

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

Now I'm in the middle of the contest

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

1 2 -1 0 2 2 1 2

for this testcase how does 0 0 work

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

.