#  User  Rating 

1  tourist  3851 
2  jiangly  3634 
3  Um_nik  3539 
4  slime  3498 
5  ksun48  3493 
6  djq_cpp  3486 
7  maroonrk  3471 
8  MiracleFaFa  3466 
9  Radewoosh  3442 
10  Petr  3426 
#  User  Contrib. 

1  isthisfft  183 
2  awoo  181 
3  YouKn0wWho  177 
4  Um_nik  175 
5  dario2994  172 
6  Monogon  170 
6  adamant  170 
8  maroonrk  169 
9  errorgorn  166 
10  antontrygubO_o  165 
0
Could you give more details for the O(mn) solution?

0
Oh, of course. Thank you! I've changed to an iterative function but it gives TL 28 now.
I'll try to code the good solution now. 
0
A naive 15line python code gives "runtime error on case 24" on problem D, but I expected something like TLE. What could be the reason for it? I usually code in C++ and I don't know what can cause a runtime error on python.
http://pastie.org/private/qsj8vbefe3flrfyuqi6ffq Thank you all! 
0
I think each problemsetter sould write a sample solution in some common language and, of course, the tutorial.

+1
dp(S), which has 2^n states, the cost of visiting all the vertices s_i in the set S.
Then, you can just visit one node, or two. This leads us to a n^2*2^n algorithm, which is too slow. Coding it in n*2^n using the fact that you can start from the first element in the set should be enough. When you visit just one vertex do one recursive call, and when you have to visit a pair of vertices just iterate on the second one (you can choose s_1 always as the first one). Precalculating distances in an array may also be useful. 
0
It also happened to me. It was path reconstruction.

Name 
