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

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

Hi Codeforces!

On Dec/03/2024 09:25 (Moscow time) we will hold Codeforces Round 990 (Div. 1) and Codeforces Round 990 (Div. 2). Note the unusual starting time!

The harder problems of this round are based on the problems from the Final round of Yandex Cup 2024, Algorithms track, that will be held at the same time.

The problems are authored by elshiko, Flyce, MrLolthe1st, sokolow, stepanov.aa, TeaTime, Tikhon228, webmonster, 4qqqq with guest problems from myst-6, Vladithur, BledDest and me.

I'd like to thank allvik66, Golovanov399, arbuzick, pperm, orz, AgafonovArtem, Qwerty1232, k1r1t0, Itsmylove1, Mak__, and errorgorn for testing the problems, tourist for helping with the round, and MikeMirzayanov for the Polygon and Codeforces systems.

Because of official Yandex Cup Finals ends later than the round on Codeforces, the upsolving, solutions, and test cases will be closed until the end of the onsite contest, roughly 3 hours after the end of the Codeforces round. It is also forbidden to discuss the problems publicly until the end of the onsite round. Any comments here concerning the problems will be removed.

Good luck!

UPD: The contest has been delayed to make sure the online contest does not start earlier than the onsite one.

Congratulations to the winners!

Div. 1:

  1. jiangly
  2. hank55663
  3. noimi
  4. cxm1024
  5. Pyqe

Div. 2:

  1. RGB_ICPC8
  2. timer2024
  3. madoka_savior
  4. ylzxxx7
  5. mion_sonozaki

UPD: You are free to discuss the problems now.

UPD: Editorial.

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

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

first comment :D

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

As a spectator, I hope tourist becomes Tourist again.

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

How come the announcement is so short. At first I thought it's a blog. I think something missing....

After EDIT : What a mysterious contest without any information. like : score distribution, number of problems etc.

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

    something IS missing.... the score distribution, but not that short.
    that's mainly because there are only few testers, and there are not any words to describe more about the staffs, which could be veeerrryyy long. heres a example from rayan announcement:
    Dear TheScrasse for his dedicated coordination efforts and lots of discussions about the problems and rejecting a big chunk of our problems for Problem C. He also contributed some problems to the contest, one of which was selected by the team!

    hey why downvoting me, I don't mean that long description is bad! just explaining why the announcement is short :(

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

    well not everyone has time or energy to post things like :

    • A super greeting (sometimes in native language)

    • ORZing co-ordinator , particular problem setter with sweet words with unlimited adjectives and follow up stories

    • Group photo in restaurant with problem setters

    • Some even start donation movement

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

    It is KAN's style to annouce very short.

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

7AM contest? Thank you, next :p

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

What will be the score distribution?

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

who are the finalist ?

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

Are finalists allowed to check the standings of the Codeforces contest during the round? (if not, how will this be enforced)?

Given that the Codeforces contest ends long before the final round ends, how is it ensured that discussion doesn't begin until after the final round ends?

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

will the rating changes for the edu contest will happen before this contest ?

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

Please change the start time, I have a school!◑﹏◐

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

What happens if someone changes from Div 2 to Div 1 (or vice versa) in Edu 172?

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

When will we know the score distribution?

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

what a problem !!!!

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

What's the score distribution??

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

arcane s2 is masterpiece

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

The contest is in less than an hour. When will the score distribution get released?

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

What's the score distribution??

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

Why did contest get delayed?

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

The contest has been delayed, and we want to go to sleep

edit:wish i was sleeping

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

One refresh costed me 20 minutes :(

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

The more the contest delayed, the higher chance we're gonna lose our rating >:

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

Where is the score distribution?

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

KAN dont be lazy, upload the score distribution for div2 atleast

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

score distribution?

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

Speedforces again. :(

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

Please avoid discussing the problems in public, including but not limited to this blog, until 11:10 UTC.

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

2 hours is not enough at all, why not 2.5h or 3h???????? (for div.1)

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

    why not 4h??????????????????????????

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

    Trash round.

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

    True, having 2 hours in a Div.1 contest really feel like another speedforces round...

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

      Div1 CF rounds have been 2 hours long historically and still sometimes are. Speedforces isn't a time problem but a balanced difficulty distribution problem.

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

        I agree, that said, it would be nice if the round was a bit longer for slow solver like me (2.5h for example).

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

        Lack of balanced problemset AND time makes it into speedforces round. More time can somewhat compensate for unbalanced problemset.

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

          No, speedforces is the problem that occurs when there are way too many problems with way too few solutions and the rest with way more, so even people high up on the scoreboard are ranked mostly based on solving time. Giving more time will only slightly increase the number of successful solutions of those too hard problems, but also increase the number of people who end up with all easier problems solved, so it'll most likely make speedforces even more extreme. It's like trying to solve your gambling debt problems by betting all you own.

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

            "...so it'll most likely make speedforces even more extreme. It's like trying to solve your gambling debt problems by betting all you own." that doesn't make sense. In the end everyone who solved all easier problems would have a speedforces round (which wouldn't be more "speedforces" than without additional time), but those who solved one more hard problem would have more of a fair cf round experience (I mean being slow wouldn't punish them that hard). So I don't think giving more time would make it more speedforces.

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

              Those very few who solved one more hard problem. When there's a massive jump in number of solutions, there's a reason for it and that reason isn't just lack of time. Also saying "it doesn't make sense" isn't an argument.

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

                I think in this round, there was quite a lot of implementation, also for the harder problems. So time was really a decider if you could just program your idea in time for one of the harder problems.

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

                Even if the number of participants who solve one more hard problem is very few (which you don't know for sure) does it mean it is not worth giving more time? I don't see any harm of writing a 3 hour contest instead of 2 hour contest even if it helps like 20-30 people.

                Maybe for someone the reason is lack of time.

                Sorry, didn't mean to be rude.

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

    Trash round.

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

nvm //I assume systests will also only run afterwards?

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

-ve delta for solving a-d :(

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

too hard.

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

I think I've seen problem 1C before

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

What was the initial start time (before it was delayed)?

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

а дорешку тоже только через 3 часа откроют?

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

System testing is over, when can I submit?

Edit: Ok, I see, about 2.5 hours more

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

why where's an easy 1C with TOO HARD D&E&F :(

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

man,what can i say,haha,oi out

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

Hello everyone!

We're currently streaming the final round of the Yandex Cup Algorithm track.

During the broadcast, we're also discussing the final problems with the competition judge. Join the stream

We're discussing some problems in Russian, and some problems in English as well.

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

The difficulty difference of this contest is too big.

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

pls someone check on zhoukangyang, hope he will be ok

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

...

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

Is this round rated?

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

Was this contest rated, cuz it's showing in the unrated contests. If it was rated, then do we have to do something while registering to attempt the rated version?

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

It is 11:32 UTC, but the editorial didn't appear... So how div2F?

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

For DIV2 C I solved the problem in O(n), but I didn't see that the constraint wasO(n2) . Why was it O(n2) when someone can solve it in o(n)...

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

Lesson learned: never ternary search on a series that had non-extrema duplicate... Costed me Div1C because of this newbie error.

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

Why is input validator for c set to 1e5? Trying to hack and it gives me

Validator 'validator.exe' returns exit code 3 [FAIL Integer parameter [name=n] equals to 200000, ... range [4, 100000] (test case 1, stdin, line 2)]
close
»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

how can we solve problem E?

i thought finding median of x and y would be enough but it seems i oversimplified the question

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

What is the solution for div. 1 C?

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

    First let's binary search the answer, call this x.

    We'll check whether it's possible to obtain this answer by doing a sweep line on the x-axis. Now we need a data structure that supports quick point update, range query. Let's maintain 2 of them, $$$left$$$, and $$$right$$$, we'll add the points by their y-coordinates and whether they're on the left or the right of the current x position we're checking, add all the points such that it's x coordinates is at least equal to the current x to the right, else to the left. Now we can just binary search for the smallest y such that $$$left(-1e9. y)$$$ >= x, and $$$right(-1e9, y)$$$ >= x. After that, we can check if $$$left(y + 1, 1e9)$$$ is also at least x, same thing for right side, now we have our answer

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

hello can anyone guys explain he's solution for problem D and big thank !!

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

can D1C/D2E be done with geometric median?

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

When Editorial?

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

Problem "For the Emperor!" is very beautiful! GG to the author <3

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

    How to solve it (Div1 D), though? I tried some min cost max flow approach but couldn't figure out how to give a cost to the whole edge (and not to using a unit of an edge, as it is normally the case in min cost max flow).

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

      I created 3 nodes {s,in,out} for each SCC, which I explain below. Sorry it may not be very clear, but the general idea is to maximize the number of nodes "covered" by a path, which is done by having a cost of -1000 per covered vertex, and as a secondary objective, minimize the total number of paths that start with an original copy (by having a cost of 1 per path).

      So for example if at the end we find that the cost is -4997, it means we needed 3 original copies to reach 5 nodes (-1000 * 5 + 3).

      The edges for a SCC compressed into a node $$$U$$$:

      • $$$src \rightarrow U_s$$$ with capacity equal to the number of messengers in that SCC, and cost = 0. This node $$$s$$$ acts as a splitter to ensure we don't exceed the total number of messengers across the outgoing edges below.

      • $$$U_s \rightarrow U_{in}$$$ with capacity=cost=1. This is to minimize the number of paths that actually start at the vertex with an original copy of the plan (the required answer). We need at most one copy per SCC.

      • $$$U_s \rightarrow U_{out}$$$ with capacity = $$$\infty$$$ and cost = 0, this represents a path that starts at the vertex without an original copy, so we must've gotten the copy through some other path.
      • $$$U_{in} \rightarrow U_{out}$$$ with capacity 1 and cost of -1000. This will ensure we cover each vertex by exactly one path, given the small negative cost.
      • $$$U_{in} \rightarrow U_{out}$$$ with capacity = $$$\infty$$$ and cost = 0. This is to say any path can pass through this vertex if it needs to, but note that this is not "covering" the vertex. The previous edge with -1000 would be prioritized first, which would cover the vertex.
      • $$$U_{out} \rightarrow sink$$$ with capacity = $$$\infty$$$ and cost = 0. This indicates that we can end a path at any point.

      Finally the DAG edges between compressed SCC nodes ($$$U$$$, $$$V$$$) would be added between $$$U_{out} \rightarrow V_{in}$$$. You can check the addEdge calls in 294690574.

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

Div.1 F1 and Div.1 F2 are completely different problems. I don't understand why this kind of subtask is allowed in a cf contest.

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

Problem div2 E is very similar to 2016 USACO Platnium’s load balancing problem: https://usaco.org/index.php?page=viewproblem2&cpid=624. Just a cool observation.

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

https://codeforces.me/contest/2047/submission/294647087 can someone pls see what am i doing wrong , its coming wrong ans for 'hhmv', when i custom run it, its giving the correct output but in the codeforces tested result its coming wrong , i am new to cp in python, pls correct me where its wrong

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

    python dictionaries are not ordered, so what might be happening is that you and the judge are going through the items of y in a different order. For the "hhmv" test case in particular your code fails if h is the first character being checked, the first if saves h as the element with minimum frequency, and the second if block does not run because repl1 = 'h' now, so h doesnt get saved as the element with maximum frequency, so at the end the wrong characters get replaced

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

I think 1C is too easy and 1D is too hard. Maybe adding one problem between 1C and 1D would be better?

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

Despite popular belief, I think this is an excellent contest because I gained quite a lot of rating. Luckily, I chose to solve E1 instead of D, since I noticed the points awarded is lower (so probably easier), and it paid off! Would like to see more contests of this sorts:)

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

1E feels like a Div2C. I wonder why so few people solved it.

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

Editorial waiting room...

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

why this post is getting many dislikes ?

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

I don't understand why problems were oredred like this. In my opinion, F1 is much easier than D, and the gap between C and D is way too large. It may be better to put F1 (maybe also E1) between C and D, so that some participants could have something to do in the last hour, instead of wasting time on a much harder problem.

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

When do we have the tutorial?

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

Editorial when?

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

Passed more than 1 day but no editorial is published yet.

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

When can I read the editorial?

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

Regarding the message received from codeforces team about my code matching, i have a proper justification for this. The other id is of my friend and both of us were together at the time of contest and thus both of us were discussing the approach and logic behind solving the problems. That is the reason behind our code significantly coinciding.

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

    When you register for the round, the rules explicitly say: "The registration confirms that you: ... will not communicate with other participants, share ideas of solutions and hacks". So you've broken the rules anyway even if you've written the code yourself.