Here is the problem: Div.2-D. Greg and Graph.
Floyd warshall algorithm.
BTW, the div.2 contest of this problem is interesting too :)
Yesterday I read this problem (https://a2oj.com/p?ID=3), and after that, it showed to me that there is a waste of some information that the solver needs to solve it.
But, surely, several unaccessible accepted submissions, made me incline to accuse my understanding.
So I, gratefully, hope you to help me in this problem.
After you read the problem statement, see this please:
Are there, in the statement, expressions that describe the whole way to construct the expansion string from the poly-line ( initial ) string? I saw that there is not enough clear explanation for it. So, all of the ways are considered true, but according to the examples, not all of the ways to construct the expansion string are accepted!!. Thanks in advance.