11200 - Sapitaur's labyrinth
Posted: Sun Jul 01, 2007 5:55 am
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
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.
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)
////
\\/\
///\
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.