10021 - Cube in the labirint
Moderator: Board moderators
-
- Experienced poster
- Posts: 154
- Joined: Sat Apr 17, 2004 9:34 am
- Location: EEE, BUET
Hi, I am trying to solve this problem. I can easlily find the shortest distance between the given cells in the lybirinth using BFS, but I am not sure what is the exact way to ensure that the cube will lay on the same side on both the starting & target points. I modified BFS to do this but finding that my program is not giving the shortest path for some test cases. Can someone give me a brief idea how to do it? Thanks in advance.
You should never take more than you give in the circle of life.
for those who will get WA a case:
answer is 12.
Code: Select all
1
3 3
1 1
3 3
h
3 1
v
1 3
Self judging is the best judging!