Page 1 of 1

11200 - Sapitaur's labyrinth

Posted: Sun Jul 01, 2007 5:55 am
by Wei-Ming Chen
My method is very simple.

Try every entrance, if it connects to exit, then ans++

if it connects to abysm, then break,

if it connects to another entrance, break and not try that entrance

for example

Code: Select all

1234  (entrance)
////
\\/\
///\
and I only try entrance 1,2,3 , because entrance 3 connects to entrance 4.
On my method,I think each road only can be searched at most ont time
but when I submit, I got TLE

I tried again and I add "If walked more then one time on a road, break"
I got wrong answer

I think that means my code try to walked more than one time on some roads

I am confused, are there some problems in my method?

Please help me, thanks very much.

Posted: Sun Jul 01, 2007 6:08 am
by rio
On my method,I think each road only can be searched at most ont time
but when I submit, I got TLE
Yes, I think though too.
I think that means my code try to walked more than one time on some roads

I am confused, are there some problems in my method?
I think there is no problem with your method. Maybe some bug in you code.

----
Rio

Posted: Sun Jul 01, 2007 6:13 am
by Wei-Ming Chen
I think there is no problem with your method. Maybe some bug in you code.
I also think so first.

But when I ask my program to print how it works on the input

Code: Select all

1
15 10
////\\\////\\//
/\\\\\/\/\/\\/\
\\\//\\\/\////\
//\\\/\///\//\\
\/\//\\/\\\\/\\
////////\\///\/
\\\\\\//\\\\\/\
\\/\//////\\///
\/\\/////\/\/\/
\///\///\\\\//\
It always run in the same way as my method

Can you give me some test cases for checking? thanks

Posted: Sun Jul 01, 2007 10:49 am
by rio
Actually, your trouble is that passing through the same road more than once, you don't need answers for testcases to debug.
Generate test cases randomly until you meet the case.

----
Rio

Posted: Sun Jul 01, 2007 11:33 am
by Wei-Ming Chen
I have found it, a very silly mistake

when each case finished, it is necessary to delete all the marks on the board N*M

but I delete the marks on the board M*N..

thanks rio remind me to generate test cases randomly, now I found it!