|
|
back to boardstop 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 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 Thank you, melkiy! I made the same mistake :( Re: stop asking #3 WA - HINT here My program got YES on this test, by have WA#3 Re: stop asking #3 WA - HINT here Thanks! Re: stop asking #3 WA - HINT here 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 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 |
|
|