ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1603. Erudite

stop asking #3 WA - HINT here
Posted by melkiy 10 Mar 2009 07:20
To all of you who cannot overcome #3 !!!

All the suggestions about redundant '\n' and about that the dictionary may have repeated words have nothing to do with WA #3 (read condition carefully).

If you use any kind of backward tracking, be it recursion or DFS, check the "no luck" condition attentively. First i used checking the next letter to be '\0' at the beginning of my recursion function, and if so returned 'true'. This is wrong! You must make word-end check BEFORE you make the next step, otherwise you may get "deadlock" "there is no direction to go" though there is no need to go anymore!!!

Test word for the example table
rabadaabracabrac: YES
(starting from [3,1] in C-like indices).
Re: stop asking #3 WA - HINT here
Posted by fuch_prog_er 28 Mar 2009 21:36
How did you get rabadaabracabrac: YES
In the condition there is said,that words could not have self-intersections. But if you don't intersect you will not get this word.
My program writes NO on this test
Re: stop asking #3 WA - HINT here
Posted by Moonstone 25 Jun 2010 13:43
Thank you, melkiy! I made the same mistake :(
Re: stop asking #3 WA - HINT here
Posted by TheDreamCatcher 30 Nov 2010 07:42
My program got YES on this test, by have WA#3
Re: stop asking #3 WA - HINT here
Posted by Edgar Rokyan 4 Oct 2011 23:48
Thanks!
Re: stop asking #3 WA - HINT here
Posted by BiteBoy [ONU] 9 Oct 2011 17:26
Thanks a lot!
Re: stop asking #3 WA - HINT here
Posted by xpahos 19 Apr 2016 02:42
It's not a test case for WA#3:

rabadaabracabrac: YES and it's not working.
Re: stop asking #3 WA - HINT here
Posted by PrankMaN 10 May 2020 04:24
My reason for WA #3 was that I tried to use 1d char array to store the table and used i -> i - 1 to go left and i -> i + 1 to go right, however, if you are in the first column you can't go left and if you're on the 4th row you can't go right