Mark_Fan's blog

By Mark_Fan, 14 years ago, In English

http://acm.timus.ru/problem.aspx?space=123&num=9&contest=true

I cann't not understand what the author really wants us to do?How to convert it into a pratical problem.

Tags dp
  • Vote: I like it
  • -7
  • Vote: I do not like it

»
14 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

You are given a graph, which consists of n vertices and edges like 2 -> 1, 3 -> 2, 4 -> 3 etc. You have to calculate number of arrangement of edges, by which you can get from 1-st vertex to n-th. Also in each arrangement from each vertex there must go out only 1 edge. (sorry for my poor english... :( )

»
14 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

I want to know if the author means that we must get from the initial state of one coin to the final state of n coins and we shall determine how many permutations could produce that.

»
14 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

After all flavoring removed: Find the number of graphs of n vertices where the outdegree of each vertex is 1, such that when taking its union to the graph (2->1, 3->2, 4->3, ..., n->(n-1)) there is a directed path from the first vertex to the n-th vertex.

b_kasenov's interpretation is slightly incorrect; coins can disappear, hence the required union step. For example, for n=4, the graph (1->3, 2->4, 3->1, 4->2) satisfies the condition since we can go following the path 1->3->2->4, taking a wait on 3 coins to let it decrease to 2 first.