PvPro's blog

By PvPro, history, 11 months ago, translation, In English

Hello, codeforces!

We are glad to invite you to Codeforces Round 1026 (Div. 2), which will start at May/24/2025 17:35 (Moscow time). This round will be rated for all participants with a rating below 2100. You will have 2 hours to solve 6 problems. The problems were prepared by XaRDKoDblCH and PvPro.

We would like to thank everyone who made this round possible:

Score distribution: 500 — 750 — 1500 — 2000 — 2250 — 3000

Our round will be dedicated to a cyberpunk theme, so get ready to save the world from robots! ;)

Good luck!

UPD: The contest is over! Congrats the winners:

via all participants:

  1. maspy

  2. Geothermal

  3. 9ovem

  4. peti1234

  5. turmax

via div.2 participants:

  1. 9ovem

  2. still_still_stellar

  3. Hellia

  4. Badint

  5. cuongaaaa

UPD: Editorial

  • Vote: I like it
  • +419
  • Vote: I do not like it

»
11 months ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it +15 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hoping that the problems will be easy.)

»
11 months ago, hide # |
 
Vote: I like it +55 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Excited for my first contest :]

»
11 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
Rev. 2  
Vote: I like it +23 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
Rev. 2  
Vote: I like it +2 Vote: I do not like it

Im sure, My laptop cannot handle Cyberpunk!

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

orz

»
11 months ago, hide # |
 
Vote: I like it -32 Vote: I do not like it

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

will the warrior race get a positive delta??

»
11 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

#pray_for_me

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

excited for this!

»
11 months ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

Lmao I am literally playing Cyberpunk currently

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hoping for a positive delta.

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hoping to get to pupil in this one :).

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Just want to wish luck and enjoyment to everyone!

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Damn, a true CP contest.

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

this photo is interesting

»
11 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

where is scores?

»
11 months ago, hide # |
 
Vote: I like it -33 Vote: I do not like it

Why is it clashing with LC biweekly :(

  • »
    »
    11 months ago, hide # ^ |
     
    Vote: I like it -11 Vote: I do not like it

    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 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

score distribution??

»
11 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

I am gonna play Cyberpunk soundtrack while solving hehe

»
11 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

希望能解出4道题:)

»
11 months ago, hide # |
 
Vote: I like it -9 Vote: I do not like it

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

  • »
    »
    11 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    aim for solving A,B within 30 minutes for 3-4 contests , after that when you are specialist focus on grabbingg more cs concepts and linking their usages in cp

  • »
    »
    11 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    i don't think you could gain 300 delta in a single contest ( probably not that easy ). aim for solving first two problems ASAP. over the time you can reach to specialist ( 1400 ) definitely.

  • »
    »
    11 months ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    4

»
11 months ago, hide # |
 
Vote: I like it -29 Vote: I do not like it

Yeah I'm * out of competition

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why Rust is not allowed?

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Gains don't stop!!!

»
11 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

What could be the difficulty range of problem C?

»
11 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

My First contest, lessgoooo

»
11 months ago, hide # |
 
Vote: I like it -55 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good contest, thank you

»
11 months ago, hide # |
Rev. 2  
Vote: I like it +14 Vote: I do not like it

TOO CLASSIC D

  • »
    »
    11 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    do you mean it is a standard ( or known ) problem ?

    • »
      »
      »
      11 months ago, hide # ^ |
       
      Vote: I like it +1 Vote: I do not like it

      yes

      • »
        »
        »
        »
        11 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        can you please tell me about this . I used some kind of DP based on what is the minimum charge required if I start at some suffix of the array..

        but I will be happy to know if the standard way

        • »
          »
          »
          »
          »
          11 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          Binary search with dp and topological sort. Too bad i was not able to debug it quick enough

          • »
            »
            »
            »
            »
            »
            11 months ago, hide # ^ |
             
            Vote: I like it 0 Vote: I do not like it

            ok thanks for sharing this..

            I also used binary search .. I will try to read editorial to understand more.

          • »
            »
            »
            »
            »
            »
            11 months ago, hide # ^ |
             
            Vote: I like it 0 Vote: I do not like it

            You don't need to use topological sort, simple DP works as $$$s_i \lt t_i$$$. So we can just iterate the vertices from $$$1$$$ to $$$n$$$ to update dp.

            • »
              »
              »
              »
              »
              »
              »
              11 months ago, hide # ^ |
               
              Vote: I like it 0 Vote: I do not like it

              Oh that would save some time. Thanks

            • »
              »
              »
              »
              »
              »
              »
              11 months ago, hide # ^ |
               
              Vote: I like it 0 Vote: I do not like it

              Why do we actually need to iterate from 1 to n and not just have a single BFS from 1? I think, I'm missing something on this problem (Node 1 BFS gives WA 6801 in TC 2; would be really interested in some failing testcase).

        • »
          »
          »
          »
          »
          11 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          there is problem called Maximize The root something , for me this problem was similar to that one of the reason it quickly led me to BS solution

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it +30 Vote: I do not like it

Problem F was very nice imo.

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      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 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        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 months ago, hide # ^ |
          Rev. 2  
          Vote: I like it 0 Vote: I do not like it

          ok so you kind of saved that last check by changing l and r values before hand.. interesting. thanks for sharing this approach

      • »
        »
        »
        »
        11 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        i guess im just lazy lol

        • »
          »
          »
          »
          »
          11 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          no no !! .. I also found it very tricky and solved it after 1 wrong submission and very late as well :( .. but I will still pray for >0 delta

»
11 months ago, hide # |
 
Vote: I like it -21 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it +19 Vote: I do not like it

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

»
11 months ago, hide # |
Rev. 8  
Vote: I like it +4 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

I used Binary Search + Dijsktra

  • »
    »
    11 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      11 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

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

      • »
        »
        »
        »
        11 months ago, hide # ^ |
         
        Vote: I like it +2 Vote: I do not like it

        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 months ago, hide # ^ |
        Rev. 2  
        Vote: I like it +1 Vote: I do not like it

        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 months ago, hide # |
 
Vote: I like it +69 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

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

»
11 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

good contest

  • »
    »
    11 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    i tried the same method and got 2 wrong attempts, i somehow still dont get why this solution is wrong

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What is the solution to C?

  • »
    »
    11 months ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    I went from left to right and kept adding the heights.. if I reach a -1 .. I assumed it to be zero and kept on moving . but I stored indices of all -1s visited till now in a stack like thing.. this stack will mean that in future I have some increment operations possible

    so if in future I reach some situation where height > r then we fail because I only have increment operation and no way to go down.. but if height < l then I can pop from the stack and increase the zero at those places to 1 .. if stack gets empty before I can increase my height .. I fail

    in the end I did one more pass to see that because I am doing increment behind the current index... all indices should still lie between l and r

  • »
    »
    11 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    greedily pick all d[i] = 1 if a[i] == -1. (get an array to remember these position, let's called this array S)

    If the current sums violate current right bound, use current S to reduce the sums (set those d[i] = 0)

    Last check if all the li <= curr_sums <= ri

»
11 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # ^ |
     
    Vote: I like it +5 Vote: I do not like it

    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 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      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 months ago, hide # |
 
Vote: I like it +17 Vote: I do not like it

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 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      11 months ago, hide # ^ |
       
      Vote: I like it +5 Vote: I do not like it

      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 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

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

        • »
          »
          »
          »
          »
          11 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          What do you mean by building vertex for every n?

        • »
          »
          »
          »
          »
          11 months ago, hide # ^ |
           
          Vote: I like it +10 Vote: I do not like it

          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 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

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

      • »
        »
        »
        »
        11 months ago, hide # ^ |
         
        Vote: I like it +2 Vote: I do not like it

        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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How did you guys do the C question? I

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What is the idea behind E?

»
11 months ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it -7 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
Rev. 3  
Vote: I like it 0 Vote: I do not like it

.

»
11 months ago, hide # |
Rev. 5  
Vote: I like it +8 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why are there so many greys in top 200??

»
11 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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

»
11 months ago, hide # |
Rev. 4  
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    11 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    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 months ago, hide # ^ |
     
    Vote: I like it +9 Vote: I do not like it

    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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it +23 Vote: I do not like it

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

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
11 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I`m just writing something

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      11 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      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 months ago, hide # |
Rev. 3  
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

l

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Now I'm in the middle of the contest

»
10 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

1 2 -1 0 2 2 1 2

for this testcase how does 0 0 work

»
10 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

.