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

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

Привет, Codeforces! Мы рады пригласить вас принять участие в Codeforces Round 980 (Div.1, Div.2), который начнется 20.10.2024 12:05 (Московское время). Обратите внимание на необычное время начала раунда. В каждом дивизионе будет 6 задач, на решение которых отведено 2 часа. Раунд будет проведен в соответствии с правилами Codeforces и будет рейтинговым для обоих дивизионов.

Задачи были составлены и подготовлены Mangooste, Tikhon228, adepteXiao, Artyom123, sevlll777, yunetive29, glebustim, Endagorion, isaf27 под руководством Ormlis и Андреевой Елены Владимировны.

Раунд основан на XXII Московской командной олимпиаде для школьников, которая является отборочным этапом для Всероссийской командной олимпиады. Также спасибо авторам задач олимпиады, которые не вошли в раунд : vaaven, TeaTime, pakhomovee, TheEvilBird, ch_egor.

Мы особенно благодарим:

  • Artyom123 за его высокоскоростную координацию.
  • MikeMirzayanov за создание Codeforces и Polygon.

Огромная благодарность тестировщикам: Kapt, SomethingNew, k1sara, Pekiban, automac, theRealChainman, marks39, cosenza, pengin_2000, SmartCoder, perchuts, Endagorion, maomao90.

А также командам, тестировавшим основную олимпиаду: (RP-1, kostylevGO, PBBx0), (AgafonovArtem, turist), (allvik66, mutant, alexxela12345), (tem_shett, crazyilian, sevlll777), (katyaporay, Igorbunov, Dart-Xeyter), Kirill22, (rama798, FlameDragon, egneeS), (alexsushin, Goshix, shevnin_d), teraqqq, (Siberian, Um_nik), (kova1, Aleks5d), (makcvim, Silver_Fox), polosatic.

UPD1: Разбалловка:

Div.2: 500 — 1000 — 1250 — 1750 — 2250 — 3000

Div.1: 500 — 1000 — 1500 — 2250 — 2750 — 3000

UPD2: Из-за проведения официального соревнования исходные коды других участников будут недоступны еще два часа после окончания раунда.

UPD3: Editorial

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

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

Обратите внимание, что раунд по времени пересекается с очным и онлайн-финалом фестиваля RuCode — https://rucode.net/final-2024/ — который пройдет с 10:00 до 15:00 мск.

Есть ли возможность подвинуть CF раунд, чтобы участники могли принять участие в обоих турнирах?

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

    Раунд проходит одновременно с олимпиадой, сложно гарантировать что участники не будут распространяться о задачах после олимпиады. Поэтому возможности провести в другое время нет(

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

The trend of rounds based on other rounds.

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

Want to see tourist rating change.

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

As a tester I can guarantee that the contest consists of at least two problems.

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

As a tester I can confirm that there are problems.

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

As a tester,

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

First time seeing so many RED author's excited to participant.

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

As a tester, as well as CEO of vulestamenkovic fan club, please join vulestamenkovic fan club.

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

Также раунд по времени пересекается с МКОШП (Московской командной олимпиадой школьников по программированию), можете заодно подвинуть раунд, чтобы и с этим мероприятием пересечения не было и я мог написать оба тура?

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

    Также МКОШП (Московская командная олимпиада школьников по программированию) по времени пересекается с раундом, можете заодно подвинуть МКОШП, чтобы и с этим мероприятием пересечения не было и я мог написать оба тура?

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

As a tester I tested.

Linkedin version: I’d like to express my sincere gratitude for the opportunity to contribute to testing the recent Codeforces round. It was a great experience that allowed me to sharpen my problem-solving skills while supporting the quality of the contest. Being involved in such a meaningful project was both rewarding and insightful, and I truly appreciate the trust placed in me. I look forward to future opportunities to collaborate and contribute further. Thank you again!

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

The MX weekly contest coincides with the time of this contest, so I regret that I cannot participate in this contest.But I will Looking forward to your next contest!

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

I have registered for tomorrow's div1, what if I lose rating points in this one and become expert, will I be able to give both div1 and div2 simultaneously tomorrow?

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

watch me drop back to cm

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

Clashes with CSP-J/S 2024 Simulation Test in luogu.

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

tourist is going to reach $$$4100+$$$ this time.

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

Last early (time) round like this also followed Meta Hacker Cup.

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

Why can't anyone in 1900-2099 register for Div.2 this time ?

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

12 contests since newbie, yet havent faced rating decrease. I hope it never comes.

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

Please, show the score distribution.

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

Score distribution LOL

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

As a participant, the girl in Ormlis pfp is cute

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

nice score distribution

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

Wish to find a good problemset.

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

having a downfall since way too long now, hoping to atleast get back to 900 today :(

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

2 hours speedrun!

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

Hope zhoukangyang can reach Top5 in "Top rated" after the contest

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

    Lost rating sadly... But the process of my performance in this contest is so dramatic that I want to share it.

    • Solved A~D.
    • Tried to solve E. Got the idea and implemented it in thirty minutes, but the code got a wrong answer. There were thirty five minutes left.
    • I didn't know why my code is wrong, so I wrote a stress test. Sadly, the code didn't failed when the n is less than 10, but it failed when n is less than 20. Due to the large scale, I couldn't analyze such a big tree.
    • In the last few minutes of the contest, I just randomly modified my code. Surprisingly, when I did a change which was useless in my mind, my code worked! I submitted my code when it was only twenty seconds left. But it got a "wrong answer on test 1"! I checked it and found that I submitted to the problem F. It was only one second left, the contest ended.
    • After contest, I submitted the code I had submitted to F to E. It passed.
»
19 месяцев назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

udgm is a cheater, you can see his submissions.

he used chat GPT to solve problems and remove comments manually.

Please Ban him

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

I have never hated a question as much as B

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

The round is based

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

Is fft required in 1C?

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

Very strong examples. I'm amazed.

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

OMG Jiangly will become 3900+ after this, can't believe it! Congratulations to jeroenodb as well for becoming LGM!

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

is Div2-D graph??

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

    Yes.

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

    nah it is like a difference array except for minimums

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

      can you explain the approach? I used dijkstra

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

        Sure, so basically we can set up our answer as $$$pre_i - skipped_i$$$ where $$$pre_i$$$ is the prefix sum up to $$$i$$$ and $$$skipped_i$$$ is how many we have skipped to get to the $$$i^{th}$$$ index. So now we just have to minimize $$$skipped_i$$$.

        To minimize $$$skipped_i$$$, it helps to see that the only possible answer for $$$i = 2$$$ is skipping $$$1$$$ (or $$$skipped_2 = \infty$$$ if we can't even reach $$$2$$$ from $$$1$$$). It follows that skipping $$$1$$$ lets us get to $$$[2, b_1]$$$ just by skipping $$$1$$$. So, in an "opening" difference array, we can place $$$a_i$$$ at index $$$2$$$ and in a "closing" difference array, we can place $$$a_i$$$ at $$$b_1 + 1$$$. This is assuming that $$$b_1 \ge 2$$$, because, otherwise, we don't have any skipping options for index $$$1$$$.

        In each index $$$i$$$, we can get the minimum skipped by processing the difference arrays (adding any ones in the opening $$$i$$$, and removing any ones in the closing $$$i$$$ to a SortedList), and we can just take the minimum in the SortedList. That is the minimum skipped at index $$$i$$$. After processing an index, we must add $$$a_i + skipped_i$$$ to the opening difference array at $$$i + 1$$$ and $$$a_i + skipped_i$$$ to the closing difference array at $$$b_i + 1$$$. Of course, you have to make sure that $$$b_i \ge i + 1$$$. I hope that this is a clear explanation.

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

          ohh i see, that makes sense. thank you

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

          Nice method, but for example if $$$ j \lt i $$$ and when adding $$$a_i + skipped_i$$$ to the array $$$[i+1, b_i + 1]$$$, we could duplicate $$$skipped_j$$$, if we had already added it to $$$[j + 1, b_j + 1]$$$ , and both arrays intersect, isn't it?

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

            Sorry but I'm not exactly sure what you're saying. The difference arrays make it so that each addition of $$$a_i + skipped_i$$$ is only two insertions.

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

              I can't believe you became purple before me

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

              Yes, I am not talking about complexity, the problem is the value added to the difference array.

              This example:

              10 20 30 3 3 3

              It can be proccessed like this :

              $$$i = 1$$$ : $$$pref_1 = 10$$$, $$$skipped_1 = 0$$$

              after we have add $$$a_1 + skipped_1 = 10$$$ to difference array $$$df = [0,10, 0 ,-10]$$$

              $$$i = 2$$$ : $$$pref_2 = 30$$$, $$$skipped_2 = 10$$$

              after we have add $$$a_2 + skipped_2 = 30$$$ to difference array $$$df = [0, 10, 30, -40]$$$

              Or for $$$i = 2$$$ we can add only $$$a_2$$$ to the difference array, because skipped_2 which is $$$a_1$$$ had been added to actual difference array, during $$$i = 1$$$.

              But by reading again, I think I misinterpreted. What are the insertion and the sorted list you talked about, and how you manage them with the difference array?

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

                Ohhh these things aren't "real" difference arrays. They are kind of like difference arrays but on minimums.

                For example, in your example $$$[10, 20, 30]$$$ $$$b = [3, 3, 3]$$$ the first step would be to process the element 10, and we see that, if we skip $$$10$$$, we can go to $$$2$$$ or $$$3$$$. So, to our opening difference array (which is a vec of vecs) at index $$$2$$$ (the vector at index $$$2$$$), we add $$$10$$$ and to our closing difference array at $$$b_1 + 1 = 4$$$, we add $$$10$$$ to the vector at index $$$4$$$.

                Then, in our iteration, when we reach $$$2$$$, we add the opening element $$$10$$$ to a SortedList (so we can easily access the minimum element) and at index $$$4$$$ we remove the $$$10$$$ from the SortedList. It might be the case that the difference arrays can store multiple values.

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

Thank you for the round, the problem div2C really good even I can't solve it in contest time. Will upsolve it later.

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

e problem is hash problem?

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

Div. 2 A-D were really good problems, however E and F were too hard and made the contest a speedforces.

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

Can anyone help me how to solve Div2 C Concatenation of Arrays problem?

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

hints on d? dp or greedy?

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

Is the solution to Div 1C something along these lines?

  • For a graph where every cycle is divisible by $$$k$$$, you can number each node with a "remainder" by simple DFS from an arbitrary node.

  • Then the added edges must all connect a node with remainder $$$x$$$ in graph 1 to a node with remainder $$$(x + C) \mod k$$$ in graph 2 for some fixed $$$C$$$.

  • We can check this efficiently by:

    • Create a sorted list $$$L$$$ of remainders for each tuple of (graph, direction), we want to check if the above condition can be achieved between the sorted remainder lists for tuples (graph 1, outgoing) and (graph 2, incoming) and vice-versa.
    • Notice that if we convert this to a list of remainder differences under modulo (i.e., $$$[L_1 - L_0, L_2 - L_1, \ldots, L_{sz} - L_{sz - 1}, (L_0 - L_{sz} + k) \mod k]$$$), the above condition is equivalent to checking if one of these lists is a rotation of the other.
    • We can check this in $$$O(n)$$$ time using KMP on [list 1] seperator [list 2] [list 2] and seeing if there is match of size $$$|list 1|$$$.
  • Also handle the obvious edge cases (outgoing / incoming list sizes not equal, all outgoing / incoming for a graph, etc) separately.

I can't see any obvious flaw in this logic but I'm getting WA on test case 2 and unfortunately writing a test generator for stress testing seems tougher than the problem itself.

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

    you can also connect the 2nd graph back to the first graph (and it's not simply just (x+C)%k)

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

    You need one extra step: checking if the new cycles formed by the edges you added alsohave lengths divisible by $$$k$$$. For all edges $$$(a_\mathrm{in}, a_\mathrm{out})$$$ from graph 1 to graph 2 and $$$(b_\mathrm{in}, b_\mathrm{out})$$$ from graph 2 to graph 1, you need to check if $$$(a_\mathrm{out} - a_\mathrm{in}) + (b_\mathrm{out} - b_\mathrm{in}) + 2 \equiv 0 \pmod k$$$.

    In your solution, this corresponds to checking whether there are a pair of $$$C$$$'s for both "directions" of edges which have a difference of $$$- 2$$$ under modulo $$$k$$$.

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

Why the example of Div1 C is so weak.I don't have any time to generate a legal input in competition.

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

sorting the pairs based on the maximum element worked for Div2C. It was intuitive, can someone please explain why it works?

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

Good contest. Great problems. Also how to solve D?

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

really cool contest, this is the first time i actually used dijkstra in a contest

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

Problem A and B were inspiring, I did them fast tho. C is kinda interesting for me (and I love graphs), just taken a little bit of time to solve. Other problems are too hard for me. I might gain rating.

In conclusion it's not undenying that this round is a STUPID TRASH ROUND.

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

what's the proof for d1A since i literally just blind guessed the sol

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

    Consider pairs $$$(a,b)$$$ and $$$(x,y)$$$. If conditions $$$\min(a,b)\le \min(x,y)$$$ and $$$\max(a,b)\le \max(x,y)$$$ are both true, it's obvious that we should put the first pair before the second pair.

    If such condition doesn't meet then their relative position doesn't matter.

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

    let inv(A, B) be the number of inversions if position of pair A < position of pair B

    if A.first + A.second = B.first + B.second then inv(A, B) = inv(B, A).

    if A.first + A.second < B.first + B.second then inv(A, B) <= inv(B, A), because max(B) > max(A) or min(B) > min(A) holds

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

Can someone explain, how to solve task C?

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

Div2 D is proof, I still don't know Dijkstra.

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

I understand that it is the contestants' responsibility to write correct code, but what is the purpose of 1C samples?

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

How to solve D?

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

Whats the solution for 2C?

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

    create a vector to store each array as a pair of integers. Next, for each array, input its two elements and store them as pairs. Once all pairs are collected, sort them primarily by the first element and secondarily by the second element when the first elements are equal. Finally, concatenate the sorted pairs into a single array, ensuring the relative order minimizes inversions by keeping smaller elements before larger ones as much as possible...

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

Any hint on D1/D (D2/F)?

I came up with some observations that a game can be added only if (wi * pi/(1-pi)) is greater than the summation of previous added weights, but couldn't use it in dp or greedy

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

    1/(1-pi)<=100, so the constraint from the statement implies that the sum of previous added weights is <=2e5. You can also use that formula to conclude that you should take at most 1/(1-pi) weights of a given pi. In total now you have 100+100/2+100/3+...=approximately 500 things you have to consider, and the sum of weights is <=2e5, so dp[i]=max probability with sum i works fast enough.

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

I used dijkstra for div2 D but I got TLE at TC24. Can someone please explain why my solution is this slow?

Submission link

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

    UPD2: Due to the official competition source codes of other participants will not be available for two hours after the end of the round.

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

    u can check that blog

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

    Are you maybe using max-heap instead of min? Thats how i got a tle at first

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

      I used min-heap. You can check my code below.

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

    Could you explain how to use dijkstra here? Thanks.

    updated: Got the idea, each index i can either submited(go to i-1) or skip(go to b[i])
    use heap to update value in correct order.

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

How to div2 E, I think it similar to https://atcoder.jp/contests/arc144/tasks/arc144_e, but i have no idea

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

    Consider the 2 graphs, for each node u can find its relative position%k, as its relative positions to each other mod k is guaranteed due to the the property of cycles length is divisible by k. We keep track of count of each position mod k separated by graph and also by input and output. What we want is for all the output of first graph to be 1 before the input of second graph. We can do this by checking equality for all rotations of k for the second graph and seeing if the 2 graphs sync together. Equality can be checked using rolling hash.

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

I have given the contest using my own personal two codeforce account so the submission I have made on both the accounts is same , so will I get penalty for the plagiarism over this?

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

Nice problemset and Problem D was beatiful

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

what's wrong with my idea of Div2 B?

I thought that — In the worst case, we always press the button with the smallest cans. So, I took the smallest can and removed all elements from it and the elements to right of it.

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

UPD2: Due to the official competition source codes of other participants will not be available for two hours after the end of the round.

So why are we allowed to discuss solutions about the mirror contest on codeforces if the official contest isn't finished?

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

Hello 2024

The Div.2 contest is numbered 2024......

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

congrats to jiangly

less than 100 points to T now

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

Maybe we would see a Tourist jiangly soon if he keep taking top 1.

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

This contest looks unusual to me only?

Here, people starting with rank around 950, till 5k have only solved ABC (some outliers with ABD), but then the ranking comes down to just who did it faster.

It seemed that C was just a hit and try to sort by max then submit, then sort by min and submit or sort by sum and submit, etc

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

    I don't know if this is correct, so I use several different ways to sort, and then calculate the inversion numbers, finally choose the least one.

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

    This has to do with the round being a combined Div1+2 round, so the purple contestants are competing in Div1 rather than Div2 when it's a standalone Div2 round. Almost everyone (~1k contestants) solved AB in Div1 (equivalently CD in Div2), and if you count these in we have ~6k solving up to Div2C and ~2k solving up to Div2D, which is a more normal ratio (around 3:1) instead of the apparent 5:1 ratio.

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

I have no proof for my C, just do guessforces...

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

    I can't see your source, but most solutions should be based on this observation: In-pair order doesn't matter, so we can put them first small and then big.

    You can observe that you pair a to come before pair b only if (a1 < b1 and a2 <= b2), or (a1 <= b1 and a2 < b2).

    You can also observe that for pairs between a and b, they would always minimize or maintain inversions due to the swapping of a and b and for those outside a and b, nothing changes.

    Although not that useful for getting the optimal complexity, you can also see the problem as a topological sort problem, as the data permits a partial ordering and you can come up with different systems that give you the optimal solution.

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

In my totally unbiased opinion, this was a good contest. Thanks for the problems!

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

    Agreed. Problems felt refreshing with tough but not impossible ideas. Haven't felt like this after the contest in a while. It even makes me want to upsolve the contest :)

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

Please uphack my $$$O(k^2)$$$ solution for D1C
287064329

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

When will the editorial be out?

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

I solved the first question but got no rating, after by code being submitted successfully. Also in the previous contest yesterday i solved the first question successfully in first attempt but got rating of -10 , can anyone explain this..

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

Six months later, I'm still 1400.I want to become blue.

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

It has been almost 4 hours since the round ended. When will others' submissions be available?

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

sir Ormlis, we cannot access the details of our submissions and others' codes currently, please fix it

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

So what's C+K+S in div1C? In Russian in could be interpreted as parity (Ч) + quantity (К) + sum (S), but it's different in English. And the solution seems to have nothing to di with parity... So what's it?

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

Ormlis when can we view solutions of others? :'(

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

I solved div2D using DP + Segment Trees. The code is short and simple. Here is my submission if anyone is interested : 287094337

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

Can anyone tell me why my Div. 2 C doesn't work? The idea: Pair (a,b) comes before (c,d) if at least two of these inequalities hold: a <= c, a <= d, b <= c, b <= d. Else, pair (c,d) comes before (a,b)

I made a comparator with this logic and sorted the pairs. Doesn't work

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

    Even I had a similar approach.

    In the comparator, I took 2 scenarios, one when Ai is on the left of Aj and then calculated the inversions caused by it, and another scenario when Aj is on the left of Ai. Then whichever is better in the 2 scenarios, I just took that.

    But this approach also gives WA on test 3.

    Can someone tell why this does'nt work?

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

    i also used comparator ,my comparator funciton that gave error on test 2: _

    wrong comparator

    after adding a small if condition gave an accepted, dont know why ...

    modified comparator

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~ can someone suggest a test case for better understanding.

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

    ig you have missed the a>=d check

    my comp function is :

    bool maxm(pair<int,int>&a,pair<int,int>&b){ int amax=max(a.first,a.second); int bmax=max(b.first,b.second); int amin=min(a.first,a.second); int bmin=min(b.first,b.second);

    if(amax>bmax)return false;
    else if(amax==bmax)
    {
        if(amin>bmin)return false;
        else return true;
    }else return true;

    }

    it works

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

    The main problem of it, is an absence of transitivity (look at the third clause here: https://mirror.codeforces.com/blog/entry/72525). This means that if your comparator tells that a < b and b < c it MUST tell that a < c.

    But with that instruction this is not allways true. For example: (6, 2) < (4, 3) (2 inequalities are true), (4, 3) < (5, 1) (2 inequalities are true), but (5, 1) < (6, 2) (3 inequalities are true).

    Without taking into account this condition (transitivity) the comparator isn't strict enough for c++, so the code can get any verdict, like RE or WA.

    But this is not the main problem. Even though it's correct, we (not a program) can not choose wich option is better.

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

In div2C probkem i wrote a program that runs in O(nlog(n) but stille got TLE. Am i wrong in my calculations or is it because python is too slow?287015824

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

Still Not Able to see others Answer

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

Ahhh...please let me see the submissions and make peace with Div2/B.. :(

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

    bro :(

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

    To solve the problem B, first sort the slots by the number of cans to prioritize slots with fewer cans, minimizing button presses. Then, start pressing buttons for each slot, collecting cans one by one. For each slot, calculate the maximum number of cans that can be collected from that slot and reduce the target number of cans k accordingly. Continue pressing buttons until you’ve collected at least k cans, keeping track of the total number of presses required. Stop once the required cans are collected and return the total number of button presses.

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

Officially 10 hours without seeing others' solutions (well 8h after end of contest)

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

Can anyone help me to solve problems C. concatenation of arrays?

How should I approach?

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

    Sort the arrays by their sum

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

    Create a vector to store each array as a pair of integers. Next, for each array, input its two elements and store them as pairs. Once all pairs are collected, sort them primarily by the first element and secondarily by the second element when the first elements are equal. Finally, concatenate the sorted pairs into a single array, ensuring the relative order minimizes inversions by keeping smaller elements before larger ones as much as possible..

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

      Brother, the code you've written and the logic that you say are different. The code is correct, but the logic that you've written in your comment is not

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

        my bad this one is my updated code!!.. actually i just sorted the pairs based on the sum of their two elements, which effectively minimizes inversions by placing pairs with smaller sums first. This approach aligns with the goal of keeping smaller elements before larger ones, even though it doesn't use standard lexicographical order. so, the logic meets the problem's requirements and gives the correct output....

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

    You can sort it by the sum of 1st and 2nd pair.

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

Seems like I was the only person in the top 800 to make the amusing move of "2023B - Skipping" problem B...

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

Why did this get removed from the home page (at the time of writing this the topmost thing on the homepage is round 979)?

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

Just out of curiosity, how did you generate graphs required for Div1 C?

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

As a tester, I managed to scam D1D using a solution that possibly has exponential runtime. However, the authors did not kill it, and it still passes in 1671ms 287035100. Feel free to hack my solution :)

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

I think "ragam_ganesh_babu" vp this contest with gpt and i am surprised that it finish div1 a,b and d,e!

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

287139892 Can someone pls tell why does this TLE ? I just iterated on the vector containing unique elements from the array inside the predicate function...

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

Can someone please help me understand the issue here:

Problem: 2024C - Concatenation of Arrays

Issue: Runtime Error on Test 4 with exit code: -1073741819 (STATUS_ACCESS_VIOLATION)

Submission:

  • 287166325 (Failed when using the comparator my_comparators for the sort function).
  • 287073493 (Accepted when using the comparator compp for the sort function).

Attaching code incase submission isn't accessible:

My Code

Thanks for the help!

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

Is there any problems similar to Div.2 C? I want to get some practice on constructive algorithm problems using greedy and sorting like this. Really appreciate it if anyone could give me some advice.

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

А где благодарность MikeMirzayanov за создание Codeforces и Polygon?

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

Can we add the following test case for Div2C & rejudge all the solutions?

2
2
10 4
4 10
2
4 10
10 4

Mangooste

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

Уважаемый Михаил Мирзаянов, мое решение Napoleon/286906288(https://mirror.codeforces.com/contest/2024/submission/286906288) совпало с решением soumil.kumar/287015730(https://mirror.codeforces.com/contest/2024/submission/287015730). Полагаю, что это произошло из-за того, что soumil.kumar использует мои шаблоны, которыми я пользуюсь на абсолютно всех онлайн соревнованиях, вероятно данный пользователь использует мой код, который я писал на предыдущих соревнованиях. Я никогда не пользовался онлайн хранилищами или ideone.com, также я никогда не имел связей и друзей в Индии, поэтому мне нету смысла помогать ему в решении задачи. Для меня, как школьника codeforces служит прекрасной платформой для тренировок и мне не зачем делиться решениями задачи с soumil.kumar, которого я не знаю и никогда не видел.

Надеюсь, Вы поможете мне в данной ситуации, большое спасибо!

P.S. Решение задачи очень маленькое, ввод-вывод очень стандартные, сортировка тоже, вероятно пользователь изучал мои старые коды, я считаю, что совпадение в такой короткой задаче вполне могло произойти, ведь в раунде участвовало много человек.

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

MikeMirzayanov , Ormlis , Artyom123 , Mangooste , Tikhon228 , adepteXiao , Artyom123 , sevlll777 , yunetive29 , glebustim , Endagorion ,isaf27

I recently received a message regarding a similarity between my solution (ID: 286971111) and another user’s solution (Mradul2004, ID: 286933028) for problem 2024C. I want to clarify that I did not engage in any form of cheating, nor do I know the other person.Here’s my code:

#include<bits/stdc++.h>
using namespace std;
#define ll long long 

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll t;
    cin >> t;
    while(t--) {
        int n;
        cin >> n;
        vector<vector<int>> p;
        for(int i = 0; i < n; i++) {
            int x, y;
            cin >> x >> y;
            p.push_back({min(x, y), max(x, y), x, y});
        }
        sort(p.begin(), p.end());
        for(int i = 0; i < n; i++) {
            cout << p[i][2] << " " << p[i][3] << " ";
        }
        cout << endl;
    }
    return 0;
}

Given the simplicity of the code and logic for this problem, I believe there’s a high chance of similar approaches being used by different participants.

I independently developed this solution and did not share it with anyone. Please let me know if there is anything further I can provide to clarify this matter(I have not used any publicly available code).

Thank you,

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

Dear Codeforces Team and @Ormlis,

I am reaching out regarding my submission (link: https://mirror.codeforces.com/contest/2024/submission/286986376), which was flagged for plagiarism due to similarities with another submission (link: https://mirror.codeforces.com/contest/2024/submission/286984393). I would like to clarify the following points to request a re-evaluation:

The logic and code structure for this problem are simple and naturally lead to similar solutions across different submissions. When a problem is straightforward, it’s common for solutions to resemble each other.

My submission includes a custom comparator function to sort a vector of pairs by their sum. This function was sourced from a publicly available answer on Stack Overflow (link: https://stackoverflow.com/questions/279854/how-do-i-sort-a-vector-of-pairs-based-on-the-second-element-of-the-pair), and it’s widely used by many programmers. Leveraging such standard resources is a common practice and does not constitute plagiarism, as the code is accessible to everyone.

The similarity in variable names is coincidental and does not imply any copying or unfair means. Common names often align across submissions when variables are named descriptively.

I assure you that my submission is entirely my work, and I adhered strictly to the contest’s rules. I did not engage in any dishonest practices.

Given these points, I respectfully request a careful re-evaluation of my submission. The similarities noted are due to the straightforward nature of the problem and the use of standard, publicly available resources.

Thank you for your consideration.

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

.

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

Dear Codeforces Team,

I am reaching out regarding my submission (link: https://mirror.codeforces.com/contest/2024/submission/287008334), which was flagged for plagiarism due to similarities with another submission (link: https://mirror.codeforces.com/contest/2024/submission/286991479). I would like to clarify the following points to request a re-evaluation:

The logic and code structure for this problem are simple and naturally lead to similar solutions across different submissions. When a problem is straightforward, it’s common for solutions to resemble each other.

My submission includes a custom comparator function to sort a vector of pairs by their sum. This function was sourced from a publicly available answer on Stack Overflow (link: https://stackoverflow.com/questions/279854/how-do-i-sort-a-vector-of-pairs-based-on-the-second-element-of-the-pair), and it’s widely used by many programmers. Leveraging such standard resources is a common practice and does not constitute plagiarism, as the code is accessible to everyone.

The similarity in variable names is coincidental and does not imply any copying or unfair means. Common names often align across submissions when variables are named descriptively.

I assure you that my submission is entirely my work, and I adhered strictly to the contest’s rules. I did not engage in any dishonest practices.

Given these points, I respectfully request a careful re-evaluation of my submission. The similarities noted are due to the straightforward nature of the problem and the use of standard, publicly available resources.

Thank you for your consideration.