Timus Online Judge
About Online Judge
Frequently asked questions
Update your info
back to board
Discussion of Problem
It's strange. My prog runs faster when n=8 than when n=7.
Maigo Akisame (firstname.lastname@example.org)
2 Oct 2004 06:55
Re: It's strange. My prog runs faster when n=8 than when n=7.
5 May 2014 11:22
If you use a simple depth first search, your run time will depend on the order in which you examine the possible moves.
For example, always examining the moves in this order yields a TLE: (1,2), (1,-2), (-1,2), (-1,-2), (2,1), (2,-1), (-2,1), (-2,-1).
To get the fastest solutions you'll want to adapt the search order at each node in the search tree, but you can get an AC with a static search order.
Timus Online Judge Team
. All rights reserved.