Page 1 of 3
10463 - Aztec Knights
Posted: Thu Mar 06, 2003 1:37 pm
by ras46
I got wa many times ..
Is there any tricky input ?
Posted: Thu Mar 06, 2003 6:50 pm
by kmhasan
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?
Posted: Fri Mar 07, 2003 2:53 am
by ras46
Hi,kmhasan.
I have handled this case , but still WA.
5 5 0 0 1 3
CASE# 1: The knight takes 3 prime moves.
Is my output correct?
Posted: Fri Mar 07, 2003 5:50 am
by ras46
I found a mistake in my sourcecode.
I got AC after correcting it ..

Posted: Fri Oct 31, 2003 8:30 pm
by Caesum
Am I right in saying that a knight at (0,0) can move to (3,1) but that a knight at (3,1) cannot move to (0,0) since one of the intermediate moves would be off the board ?
Posted: Fri Oct 31, 2003 9:40 pm
by 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).
Posted: Sat Nov 01, 2003 2:02 am
by Caesum
any ideas for avoiding a tle on this ? at the moment i pretty much do brute force with some heuristics but it is slow........
Posted: Sat Nov 01, 2003 2:04 am
by Dmytro Chernysh
The same problem Caesum...
Posted: Sat Nov 01, 2003 5:05 am
by kmhasan
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.
10463 Aztec knights
Posted: Mon Dec 01, 2003 6:21 am
by wiltord
how to understand the second data set in the sample. i can't find a two steps move from (0,0) to (4,4).
Posted: Mon Dec 01, 2003 8:51 am
by sohel
Hi Wiltord,
Perhaphs you misunderstood the question.
Aztecs Knights are special: they move three spaces horizontally/vertically and one space vertically/horizontally.
So (0,0) to (4,4):
(0,0) to (3,1) - 1st move.
(3,1) to (4,4) - 2nd move.
Hope it helps.

Posted: Mon Dec 01, 2003 11:25 am
by wiltord
I have found the way now,it is really i misunderstood the move rules.thank you!

[/quote][/cpp]
Posted: Mon Dec 01, 2003 4:20 pm
by wiltord
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
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!
10463 Aztec knights how to avoid tle
Posted: Tue Dec 02, 2003 4:12 pm
by wiltord
who can help me? I can't really find an effective way to avoid tle. thanks before.
Posted: Wed Dec 03, 2003 8:12 am
by Larry
BFS should be enough..