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

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

You are given a connected undirected graph with $$$n$$$ nodes and $$$m$$$ edges. Each node $$$u$$$ has an ordered list $$$l_u$$$ of its neighbors, and an arrow pointing to one of its neighbors $$$p_u$$$. Initially, $$$p_u$$$ is the first neighbor in $$$l_u$$$.

You start at node $$$s$$$, and repeat the following process infinitely many times:

  • Let $$$v$$$ be the node at which you are currently located. Move from $$$v$$$ to $$$p_v$$$.
  • Increment $$$p_v$$$ to the next neighbor in $$$l_v$$$ cyclically.

Consider the list $$$p_1, p_2, \cdots p_n$$$ over the course of this process, as well as the current node $$$c$$$. We call this a state.

Print any state that appears an infinite amount of times.

$$$n, m \leq 10^5$$$

Link to Problem


it's just sitting there, all alone, it needs a hug :(


some more great problems from the Rutgers Programming Contests

Hungry Arachnid

Domino Swap

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

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

:hug:

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

hungry arachnid is a good problem yayy