10463 - Aztec Knights
Moderator: Board moderators
10463 - Aztec Knights
I got wa many times ..
Is there any tricky input ?
Is there any tricky input ?
it may happen that you can reach the destination in 1 move (which is composite) but you can reach it in 3 moves (which is prime).
does your solution handle those cases?
does your solution handle those cases?
K M Hasan
http://www.cs.umanitoba.ca/~kmhasan/
http://www.cs.umanitoba.ca/~kmhasan/
No. I think if a knight can go from (0,0) to (3,1) then it can also go from (3,1) to (0,0).
K M Hasan
http://www.cs.umanitoba.ca/~kmhasan/
http://www.cs.umanitoba.ca/~kmhasan/
-
- Experienced poster
- Posts: 146
- Joined: Sat Apr 26, 2003 2:51 am
Spoiler follows:
I run a IDS (Iterative Deepening Search) keeping track of the cells I visit while searching within a certain depth. If this track is kept, then we are not going to explore the cells in that depth again if it leads to unsuccessful searches.
A preprocessing with BFS can make the solution run even faster. In that case we can use the prime numbers as the depth of IDS.
I run a IDS (Iterative Deepening Search) keeping track of the cells I visit while searching within a certain depth. If this track is kept, then we are not going to explore the cells in that depth again if it leads to unsuccessful searches.
A preprocessing with BFS can make the solution run even faster. In that case we can use the prime numbers as the depth of IDS.
K M Hasan
http://www.cs.umanitoba.ca/~kmhasan/
http://www.cs.umanitoba.ca/~kmhasan/
10463 Aztec knights
how to understand the second data set in the sample. i can't find a two steps move from (0,0) to (4,4).
my goal: master algorithms
please tell me more specificly,how to do with the keeping track of the cells and not going to explore the cells int that depth again! thank you!I run a IDS (Iterative Deepening Search) keeping track of the cells I visit while searching within a certain depth. If this track is kept, then we are not going to explore the cells in that depth again if it leads to unsuccessful searches
my goal: master algorithms
10463 Aztec knights how to avoid tle
who can help me? I can't really find an effective way to avoid tle. thanks before.
my goal: master algorithms