Page 1 of 2
Posted: Thu Aug 29, 2002 4:53 am
is there any trick on this problem? i've got WA on this.
first, i search all the room visitable by the cat and put the flag on.
next, i just search all the room visitable by the mouse. If the room's flag is on then mouse can meet the cat. if later, the mouse starting room is visited by the mouse again, then the cat can walk between rooms without having to meet the cat.
my solution works with the sample test case and official test case (ACM94). Do i miss something here?
274 runtime error ?!
Posted: Wed Sep 18, 2002 6:07 am
I keep getting runtime error for this problem. I do not think I am reading the input correctly. Can someone show me how to read the input for this problem?
Posted: Mon Feb 24, 2003 9:20 am
Look out... the input is tricky !!
There can be no mouse or cat doors....
So make sure that you have considered such a possiblity... (this was my mistake ..)
274 cat & mouse TLE
Posted: Sat May 17, 2003 8:56 am
i cant believe i got TLE for this problem. i've use DFS and also Transitive Closure, both of them got TLE. Do you have any suggestion or sample critical input ?
with love & light
Posted: Sat May 17, 2003 9:27 am
Try to use BFS (something like floodfill). I got 0.031 sec that way
Posted: Sat May 17, 2003 9:46 am
well i use something like flood_fill too, but i think that's DFS. how can you got AC?
oke here is my code :
--- cut got AC----
Posted: Sat May 17, 2003 10:37 am
Don't expect any help from me when you give wrong information
I spent almost half an hour looking at your code trying to find the cause of the TLE that you said you had. Then I submitted your code to the judge and got WA in 0.045 sec!
I tried to help you, but was looking in the wrong direction because you gave me the wrong information.
Your code is correct in principle, but doesn't catch all tricky input. But I am not going to help you anymore.
Posted: Sat May 17, 2003 3:20 pm
hey sorry i dont mean to give wrong information. i'm pretty sure that i got TLE because i submitted it several times. perhaps i removed / added some lines before i posted it ( i forgot). i dont know why i got WA now. please forgive me.
with love & light,
Posted: Sat May 17, 2003 3:29 pm
anyway thank you very muc, little joey. now i got AC. there is a small bug in my code.
with love & light,
274- Cat n Mouse - TLE
Posted: Thu May 29, 2003 1:34 pm
i had tried 5 types of coding for this problem
using linked list.
but in the end , i got the same result.
TIME LIMIT EXCEEDED.
Posted: Thu May 29, 2003 2:52 pm
I use two DFS and got Acc in 0.301 sec If I correct remember ...
Posted: Sat May 31, 2003 11:23 am
i used 2 DLinked list, or he cat n the mouse
i tried the sample case from the web
n i got the correct answer.
but now when i submit it , WRONG ANSWER.
"Your program has not solved the problem. It ran during 6.598 seconds"
i wanna ask
1. the problem said that the first answer is 'y' if the cat can meet the mouse in some room. is it means there shoud be more than 1 room where they can meet each other (2 rooms or above) to get the first 'y'?
2. can the cat meet the mouse in the mouse first room or can the cat enter the mouse room?
i already test my source code in thousands of case n i think i got the right answers for all of them. but its still wrong answer in the end
i assume that in the cat's first room, there is a cat.
so if the case is:
10 1 2
100 50 50
the answer is
"y n" -->or "n n" how many meeting rooms required to get the first 'y'?????
and for the seccond case
"y n" -->or "n n" ?????????????
can somebody help me with some other sample case??
i just wanna make sure that i am right
Posted: Sun Jun 01, 2003 6:08 am
i finally got accepted
even it's still PE
thanxx for your help
Posted: Sun Jan 04, 2004 5:04 pm
For all who still have TLE:
My problem was that I thought that there must be a blank line after description of mouse doors, but there needn,t.
Posted: Thu Jun 15, 2006 3:10 pm
i am constantly getting wa with this problem
so can somebody please help?
is the input realy in this format?
rooms cat_start mouse_start
list of cat edges
list of mouse edges
the same for next case
i consider following tricky cases:
- cat and mouse have the same start room: Y N
- there are no cat or mouse edges
are there more tricks? thank you