bobbilyking's blog

By bobbilyking, history, 12 months ago, In English

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

  • Vote: I like it
  • +18
  • Vote: I do not like it

»
12 months ago, hide # |
 
Vote: I like it +28 Vote: I do not like it

:hug:

»
12 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

hungry arachnid is a good problem yayy