10507 - Waking up brain
Moderator: Board moderators
-
- New poster
- Posts: 38
- Joined: Mon Dec 09, 2002 1:53 pm
- Location: Poznan, Poland
10507 - Waking up brain
It seems to be an easy problem, but I steel get Wrong Answer. I simply use BFS, but I add the vertex to queue only if it is connected with three vericies I visited earlier. If the BFS doesn't visit all areas I output "THIS BRAIN NEVER..." otherwise I output the time that is needed to wake up the brain. Is this algorithm wrong or is there some tricky input? And if some edge is given in input more than once should I ignore each another or use all of them?
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
-
- New poster
- Posts: 38
- Joined: Mon Dec 09, 2002 1:53 pm
- Location: Poznan, Poland
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
-
- New poster
- Posts: 38
- Joined: Mon Dec 09, 2002 1:53 pm
- Location: Poznan, Poland
My finally accepted program gives:
Code: Select all
WAKE UP IN, 3, YEARS
WAKE UP IN, 0, YEARS
THIS BRAIN NEVER WAKES UP
THIS BRAIN NEVER WAKES UP
-
- Guru
- Posts: 834
- Joined: Wed May 29, 2002 4:11 pm
- Location: Wroclaw, Poland
- Contact:
Thanks Adrian, I got Acc too ... in contest appears message that problem A has more than one inputs in file, but nothing was posted about H ...
Finally I got one more input, on which my program fails:
5
6
ABC
AD
AE
BD
BE
CD
CE
WAKE UP IN, 1, YEARS
Best regards
DM
Finally I got one more input, on which my program fails:
5
6
ABC
AD
AE
BD
BE
CD
CE
WAKE UP IN, 1, YEARS
Best regards
DM
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)
Born from ashes - restarting counter of problems (800+ solved problems)