11200 - Sapitaur's labyrinth

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

Moderator: Board moderators

Post Reply
Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

11200 - Sapitaur's labyrinth

Post 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.
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post 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
Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Post 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
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post 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
Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Post 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!
Post Reply

Return to “Volume 112 (11200-11299)”