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

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

The idea behind my solution is that in the optimal path you don't enter any vertex after the first time it can be entered + n. I wonder if there is a proof that this works correctly or a way to disprove it, but I'm having trouble finding either. If anyone is interested, please help.

329877256

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

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

I did the same with +5050 instead of +n. I summon the hack gods to sacrifice my solution https://mirror.codeforces.com/contest/2122/submission/329873748

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

i did the same but with degree of the vertex + 4 instead, had it been exactly degree of the vertex i could've hacked it but not sure how the + goes

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

    hacked.

    I would like to reply with the same message to Pox_2000 as he expressed a similar idea below: You can enter a branch of one node in the shortest path and then move back and forth in the branch many times until you can move to the next node in the shortest path. Here, we can add useless edges to make sure we have to stay in the branch for at least $$$\mathcal O(\sqrt{n})$$$ seconds (I don't know if there exists a straightforward construction that makes it $$$\mathcal O(n)$$$ so I only submitted one such $$$\mathcal O(\sqrt{n})$$$ test case). In contrast, the degree of nodes in the branch is $$$\mathcal O(1)$$$.

    I believe that $$$+n$$$ is correct (I implemented the same thing in contest), but I'm looking for a formal proof too.

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

I’m pretty sure you can reduce $$$n$$$ to $$$deg(v)$$$ of the vertex you are on (correct me if I forgot an additive constant).

The main logic is this: say instead of moving in a loop for $$$d$$$ time from $$$v$$$ back to $$$v$$$, you wait for some seconds $$$t$$$ before selecting the edge and moving away. Since the selection operation cycles every $$$deg(v)$$$ seconds, you can enforce $$$t \lt deg(v)$$$ seconds. So even if you loop around without stopping, if $$$t \lt d$$$ then this is never going to be optimal since you can cut the loop off and just wait for $$$t$$$ seconds.

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

I made the same assumption and my solution has been helpfully hacked. I believe the same test should work for your solution as well, here's my submission: 329875868