10021 - Cube in the labirint

All about problems in Volume 100. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Mohammad Mahmudur Rahman
Experienced poster
Posts: 154
Joined: Sat Apr 17, 2004 9:34 am
Location: EEE, BUET

Post by Mohammad Mahmudur Rahman » Tue Nov 09, 2004 10:18 pm

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.

New poster
Posts: 19
Joined: Wed Jul 21, 2004 11:14 am
Location: Suceava, Romania

Post by matrix2 » Sat Nov 13, 2004 4:03 pm

I can tell you that moving the cube on the board may be simulated. For the algo, I think a BFS is the solution
Things are simple, but we make them complex.

Experienced poster
Posts: 160
Joined: Wed Jul 30, 2003 8:10 pm

Post by shanto86 » Wed Aug 16, 2006 6:53 am

for those who will get WA a case:

Code: Select all


3 3
1 1
3 3
3 1
1 3
answer is 12.
Self judging is the best judging!

Post Reply

Return to “Volume 100 (10000-10099)”