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

Автор henotrix, 13 месяцев назад, По-английски

Hello, Codeforces!

I am glad to invite you to take part in Codeforces Round 1045 (Div. 2), which will start on Aug/26/2025 17:35 (Moscow time).

You will have $$$2$$$ hours to solve $$$6$$$ problems. The score distribution is listed below.

There will be at least one interactive problem, so make sure to read the guide for interactive problems before the contest.

The round will be rated for participants whose rating is below $$$2100$$$, but higher rated users are also welcome to participate out of competition.

The problems were authored and prepared by me. I would like to thank:

Good luck & have fun!

UPD: Score distribution: $$$500 - 1250 - 1250 - 2000 - 2250 - 2750$$$.

UPD2: Editorial

UPD3: Congratulations to the winners!

Div. 1+2:

  1. Hamed_Ghaffari
  2. Otomachi_Una
  3. potato167
  4. Daniel_lele
  5. Rubikun

Div. 2:

  1. cly312
  2. polosatic
  3. Gheal
  4. Transformer911
  5. Timur_Kotlyarov228
  • Проголосовать: нравится
  • +328
  • Проголосовать: не нравится

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

As a tester, I think the whole problemset is awesome! orz to author for making so much interesting problems!

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

As a tester, detset I.

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

As a tester, interesting problems and a really good contest.

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

As a participate, I think we need less interactive problems (5 in a Row!)

I like them btw but my rating doesnt

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

As a tester, the problemset is one of my most favourite one. Good luck, hope you would enjoy it.

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

Speedforces?

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

As a participant, i hate interactive problems.

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

Good luck!! :)

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

I think that interactive problems are overhated

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

Practicing interactive problems would be beneficial, especially given the performance in the last two contests.

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

I think, Contest will be math related. Because author is from China.

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

The score distribution seems interesting

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

I prefer interactive questions, which are more interesting than regular questions and relatively easy to add points

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

Is there any proper approach for interactive problems

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

why interactive problem why

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

this is my first contest,I'm so xcited!

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

As a tester, I like this problemset.

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

When was the last time problem B was an interactive problem in a Div2?

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

Are problems B and C hard or medium? What is the prediction for today?

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

Holy Lord Jesus Mother of Speedforces!

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

Problem $$$B$$$ is actual cancer.

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

I want to submit a problem but I haven't registered :((

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

If the writer's for the contest can't properly control the difficulty gradient of your questions, please refrain from setting problems and harm others. These rubbish rounds are wasting every participant's time!

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

    skill issue

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

      A reasonable level of differentiation is essential for a good tournament. It's not only grandmasters who deserve to compete; every participant should have the opportunity to compete at their appropriate level.

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

    It's very discouraging to see your rude words.

    First of all, you didn't even solve a single problem from the contest — how can you just call it "trash"? Do you know anything about the problem qualities? Authors, coordinators, and testers put endless efforts to make this round possible, but you are just staring at standings and send offensive comments. Aren't you too rude?

    Actually I found most problems enjoyable and interesting. The only issue is C being too easy — that's very hard to estimate difficulty for easy problems, so it is understandable for me. All the rest problems have nice difficulties. What are you complaining about?

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

      On one hand, although I didn't submit, I attempted all problems except F but only solved A, B, and C. On the other hand, even without solving any problems, the gap in pass rates between C and D clearly shows this is an unreasonable difficulty span (7000 to 400). The difficulty of C didn't deviate excessively from the norm, but D far exceeded the typical difficulty of a Div2D problem (it would be more reasonable to place it in the E).

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

      i'd be moved by your words if this contest wasn't this much garbage

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

      I agree that he was way too rude. However:

      All the rest problems have nice difficulties. What are you complaining about?

      You could get green performance to yellow performance by just doing ABC. At this point what is the contest actually testing? I think DEF were master+ level problems and it sucks that they were the only other problems in this problemset after C, because they are otherwise very interesting.

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

    I'd argue the problems are really good despite the round being horribly unbalanced. Tbh rounds like this have been a problem since I've been blue and it really sucks that otherwise good problemsetters forget that the contests are made with a target audience in mind. A div2 contest should differentiate between cyans, blues and purples, not put everyone at 3 problems.

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

      Have you heard of pigeonhole principle?

      You're either

      1. suggesting to increase number of problems, or
      2. asking authors to somehow make accurate predictions of solve counts

      both of which sounds incredibly stupid, especially when solve count ratio doesn't even look bad in the first place.

      Furthermore, why does having same number of solve count matter when ranking is based on sum of scores instead of solve count?

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

        I'm suggesting that div2 contests have problems that focus on differentiating div2 participants. I don't think it's crazy to say that it is expected of an expert to do ABC as much as it is expected of a green to do ABC. My point is that it doesnt make sense for DEF to be on the same div2 contest. They would individually be good problems on different div2 rounds. I do not believe you need to be particularly accurate to notice there is a big gap between C and D.

        solve count ratio doesn't even look bad in the first place.

        C has 20x more solves than D. This is pretty significant since this difficulty range of most div2 participants.

        Have you heard of pigeonhole principle?

        If you have 3/4 problems that div2 are expected to solve and 5 div2 ranks, you are practically guaranteed to run into a speedforce situation. In this case it was particularly bad because 2/3 of these problems fell under the same pigeonhole.

        Maybe you could argue that the only problem was that C was easier than expected, and otherwise the difficulty curve would be reasonable. However, it is expected that they would make the problem too easy, since there were only expert+ testers, and they are expected to do C every time.

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

          My point is that it doesnt make sense for DEF to be on the same div2 contest. They would individually be good problems on different div2 rounds. I do not believe you need to be particularly accurate to notice there is a big gap between C and D.

          C has 20x more solves than D. This is pretty significant since this difficulty range of most div2 participants.

          You have a fundamental misunderstanding of problem difficulty. It's not a fixed number assigned to each problem. For today's D, this 20x number could easily fluctuate to 5x depending on whether there was an easy diameter-related problem on some recent round.

          It's very hard to make sense of your argument when it revolves entirely around final solve count, which is not a number that is available to authors.

          If you have 3/4 problems that div2 are expected to solve and 5 div2 ranks, you are practically guaranteed to run into a speedforce situation.

          "speedforce" is a word invented for the purpose of some people getting validated on codeforces comment section. Speed matters on every contests regardless of difficulty distribution as long as the contest has finite duration.

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

    Hi, I'm not sure if it's too difficult for rated participants. I just came here to state some of the facts.

    • No author means to set extremely hard problems for Div 2. Div 1's are worth much more money. And, of course, we have no fun when seeing contestants suffering.
    • We had an army of testers. Nobody complained that it's hard for this position. Well, I might be biased, but I don't think everybody was.
    • If you are interested in improving the difficulty gradients of Div 2 contests, you are welcome to test the upcoming rounds and share your friendly feedback, instead of ranting under every announcement. Ranting doesn't make things better.
    • »
      »
      »
      13 месяцев назад, скрыть # ^ |
      Rev. 2  
      Проголосовать: нравится +10 Проголосовать: не нравится

      We had an army of testers. Nobody complained that it's hard

      • There's only 4-5 regular div2 rated testers though...
      • And not all testers might actually care in those details about the quality of a contest.
      • Moreover, friends of a problem-setter probably have similar problem solving approaches and thinking.

      I only meant to say just counting the number of testers for a round can't be enough reason.

      Anyway thanks for the contest.

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

    Hi, thank you for the comment. Trust me, it is also heart-breaking for me to see the results doesn't match my expectations.

    As for the gap between C and D, I think I made a mistake here. Originally the problem only asks for the minimum number of operations, which doesn't raise any suspicion that it might be too hard from the testing results. A few days before the contest we added the first operation output to prevent it from being too guessable (also some testers think that it is too easy for its place). I thought the difficulty would be the same, but after the modification, there are few Div.2 testers tested the round. Now I learn that problem modifications can be really tricky, and we should value Div.2 users opinion more :(

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

500−1250−1000−2000−2250−2750

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

I am quitting cp now, no more

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

Great D

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

the worst contest ever

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

codeforces round look inside speedforces round

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

someone tell me what was the logic for c about time i quit cp

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

Can anyone tell why this is giving wrong answer https://codeforces.me/contest/2134/submission/335699285 It works on my VSCode :(

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

Is there any specific technique to solve D, or is it observation based only??

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

how to solve E

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

Who felt that question C was easier than question B?

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

Is D something like: find the vertex with the longest chain going out of it (chain -> path connected to the vertex with no other vertices connected to that path) and let it be our c, and let our a be the vertex going into that chain from c

Additionally we need to consider a special case when there is only 1 vertex with number of children > 2

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

The problem was standered enough.

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

As a contestant i really enjoyed the problems though i could solve only 3

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

it was fun being purple again for two days i guess

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

Problem difficulty goes from PUPIL to MASTER , what's the point of these half-baked rounds,wait for one or more intermediate problem and make a proper round.

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

Guessforces. And great gap between C and D.

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

Problem $$$C$$$: 8.9k

Problem $$$D$$$: 493 lmaooooo

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

What the hell was B & how did 10k+ solved that question?

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

    kinda spent more time thinking for B than C... saw C quite quickly ( if I am right )

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

    It was easy

    When k is odd -> You have to just add k once to all odd values, and the gcd of overall array will be 2

    When k is even -> Just add k to a[i], (a[i])%(k + 1) times, the overall gcd will become k + 1.

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

      How did you came to the solution when k is even?

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

        Let's consider ai = 5, k = 2. If you add 2 two times, 5 will become a multiple of 3. Take any odd number and k = 2, either you will add 2 to it one time, then it will become a multiple of 3, or two times. In case of ai = 7, just add 2 once, and 9 is multiple of 3.

        Try to generalize the idea, that we can make a number mulitple of k + 1 by adding k at most k times.

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

        Let g be the final gcd of A, we must add 0 or multiple k to make A[i] divisible by g. In other word, let r = A[i] % g, c = number of k adding to A[i], for every A[i], we should guarantee that there exists a c >= 0 where (A[i] + c * k) % g == 0. This actually means every number within [0, g — 1] should be achievable by this g which implies gcd(k, g) == 1. You can find this g by brute force in just few iterations. You can see k + 1 mentioned by other people is just a special case since gcd(k, k + 1) == 1.

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

    It's a bit easier if you first think about how you would solve it for k = 1; Obviously the best way is to make every element even. Then, you can try to solve the case k = 2, and even though you can no longer change the parity and make elements divisible by 2, you can note that it is possible to change the remainder when dividing by 3, and thus make every element divisible by 3. From there, you can generalize to all values of k, where for each k, you make every element divisible by k+1.

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

someone please tell me D was NOT re-rooting DP .. because then I will know I was not on right path and I will not cry :(

BTW <500 AC for div2D ... SPEEEDFORCESSS...

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

the div2 problem B is tooooo hard TwT

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

As a newbie apart from A I couldn't solve any other question :(

Ps: Got 4 wrong answers.

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

I could only figure out a solution to E that uses $$$\frac{3n}{2}$$$ queries on average, but I couldn't find a worst case $$$\frac{3n}{2}$$$ query solution :(

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

Cool E! I really enjoy it.

My Solution

AC code

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

As a newbie,I want to ask for help:How D?Thx.

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

problem difficulty

A — 1

B — 2.9

C — 3

D — TREE(3)

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

nice round, i tend to think that D is harder than E

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

Nevertheless, the quality of the questions in this competition is very high!

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

.

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

How in C just checking subarray of size 2 and 3 is enough.

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

    Just consider the length of 3, and make a special judgment for length 2 when n=2.

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

    Let's consider the array is a1, a2, a3, till an

    If a2 >= a1 + a3 and a4 >= a3 + a5. Now if you take array of two size let's say a1 and a2, then we already made a2 >= a1 + a3, and the minimum value of a3 can be zero, so overall a1 will be greater than a2. Now if you consider 3 size array, then a2 >= a1 + a3. If you consider 4 size array let's say a1,a2,a3,a4. Here a2 >= a1 + a3 and a4 >= a3, so a2 + a4 >= a1 + a3.

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

i want atto round 2 with Hamed_Ghaffari

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

hard D boring E

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

3 solved people range is too wide, but regardless of it, i enjoyed round thx :)

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

good contest :) but it will be better if the writer swap(problem D, problem E)...

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

What was the reason for the unusual output format in problem D? I can understand not forcing us to write the full sequence of operations because the implementation would be quite annoying and the fact that the number of operations is O(n) somewhat spoils the solution, but I don't see why the output couldn't just be the minimum number of operations required. Is it really because the answer being

Spoiler

would be too easy to guess?

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

    Double on that, at least it could have included both the minima and the operation too.

    That just makes people think on some random operation that might be part of the solution not thinking on the actual problem, idk how such simple thing passes over coordinators and so many testers.

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

WA1 sent vs judged difference is probably too big.

Sent 2025-08-26 17:50:26

Judged 2025-08-26 17:54:32

https://codeforces.me/contest/2134/submission/335630967

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

what would you rate the difficulty of problem B? 1200? 1300? 1400?

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

Can someone explain why this weird solution passes for B?

trying to make it work for primes under 100

335688760

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

    Similar code here only primes <= 29 needed to be precise. The idea is that you just need to find a prime number that does not divide k, so that you can keep increasing each number by k until the number becomes divisible by the prime chosen. Update: It seems any coprime number with k instead of a prime will work as well.

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

Great contest, thanks!

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

Need to ban:

akm19117012

RustyQuantPP

skebeb

ssnaik

Dudududududududud

TejasBharadwaj

humble.fool

for problem F, and it is only first page and I am lazy(sorry)

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

loved that D problem. The solution is incredible even though i miserably failed finding it!! (as always)

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

C was easier than B.. I wasted all my time on B did not even look at C.. so pathetic.. how can I avoid doing this in future? I mean can't just go through all the problems to determine which one should I solve..

should I read all the problems with same score then decide which one I want to solve first..

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

Can someone help with the last step of C?

  1. I get that each even number must be at least the sum of its two direct odd neighbors.
  2. I also get that each odd number can be at most as high as their lowest even neighbor.
  3. It would be better to decrease an odd index where both its even neighbors benefit from decreasing it.
  4. I assume we have to use DP, since we are looking for a minimum.

But then I am stuck...

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

    You can solve the problem using just this fact: Every even number must be at least the sum of its two neighbors.

    First, lets solve the problem for the first number at an even index: $$$a[2]$$$. Notice that its always better to subtract from $$$a[3]$$$ first as that will affect $$$a[4]$$$, meanwhile subtracting from $$$a[1]$$$ won't affect $$$a[4]$$$. Now notice that when we move on to the next even number, $$$a[2]$$$ is satisfied. So again its better to subtract from $$$a[5]$$$ first.

    In general, it is always better to subtract from $$$a[i+1]$$$ (where $$$i$$$ is even) before you subtract from $$$a[i-1]$$$.

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

In problem D, I am getting "wrong answer given tree is not a path graph, but -1 found (test case 5)" for test case 2(truncated)

5447
1
2
1 2
3
3 2
1 3
4
4 1
2 1
2 3
4
4 3
3 2
3 1
5
3 4
1 3
5 2
1 2

But 5th test case which is the last one here, it is a path graph right? As per their definition written on the problem statement.

"A path graph is a tree where every vertex has a degree of at most 2 . Note that a graph with only 1 vertex and no edges is also a path graph."

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

Good Round

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

"Sometimes the issue is not taking something as an issue…" I was considering a case but didn’t realize it was the corner case missing from my test data! Finally, I’m happy to score 3 problems, Siuuu… #CodeForces

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

Lucky Contest.

To get exactly 1400 with +17 and become a specialist !!!

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

I don’t understand such hate for problem D. If you look from afar, it is obvious that the diameter of the graph should be included in your final bambuk. And since there is no longer route than the diameter, we should move points that are not in the diameter. It was my first thought after I read the problem.

So I agree with henotrix that just answering n-1-diameter would be kind of guessable. Yes, it might look a bit strange that the output is the first move, but for problem D, just giving the minimum number would be trivially easy and not really appropriate.

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

I am struggling in solving B. I am not able build any intuition can anyone help how they solved it. Please

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

    You can make all the elements of vector divisible by (k + 1) by changing their value to x + k * (x % (k + 1)) where x is an element of vector. Do this for each element and gcd has to be atleast k + 1

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

      Yes i understood the solution using K+1 but how to get the idea during contest. i am feeling helpless from yesterday as i think if i had not seen the K+1 solution i would ever come to the conclusion. How did u get that idea???

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

        you need not do it with (k + 1) only you can do it with any number co-prime with k (k + 1 comes to mind the earliest as it is guaranteed coprime with k). After selecting a number you just have think mathematically what multiple of k has to be added for each element to make it divisible by your selected number.

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

        and about the intuition, If you get odd k, you can make all elements divisible by 2. If you get k = 2, you can make all elements divisible by 3. thinking a bit more you can figure out the formula

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

It's funny to see how the difference between top 600 and top 7000 is only the speed ppl do the first 3 problems

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

I don’t know why it took so long to get the verdict on problem B. It showed 'Pretests passed' about 3 minutes after I submitted the code. Also, due to the Cloudflare verification after submission, I had to resubmit the code. Please try to fix these issues.

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

Hello, My solution for Problem C ("Even Larger") was skipped for plagiarism detection. However, I want to clarify that I wrote the code myself by following the intended greedy approach described in the official editorial:

As explained in the editorial , only subarrays of length 2 and 3 need to be considered.

The correct solution is to use a greedy algorithm that decreases elements minimally so that the condition holds.

My code implements exactly this approach: at each step, I compute the minimal possible value to subtract (mini), ensure constraints for length-2 and length-3 subarrays, and carry forward a state (prev) to enforce correctness.

Therefore, my solution matches the standard editorial method, not any copied code. I kindly request that my submission be reviewed again. problem code link (335665812)

Thank you.

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

Attention!

Your solution 335622185 for the problem 2134A significantly coincides with solutions MASTER_RAFAT/335621768, wwwglll/335622185. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.me/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

First of all, I don't know this person, and the time between his code submission and mine was less than a minute. Secondly, this is a relatively simple problem, and having similar logic in the code is quite common. You can check all my submitted code—it was entirely written by me.