|
|
back to boardWA28 Posted by hatred 7 Aug 2011 20:47 I sort all variants for each problem in lexicographic order. First I output first variant for first problem. Next I compare last outputted word and first variant fo next problem, if it is not satisfies I compare last output and second word etc. If all variants are incorrect I print "IMPOSSIBLE". Last I print words in founded order. Where is my mistake? Sorry for my English. Re: WA28 Posted by Ignas 9 Aug 2011 00:46 From the 3 names you should choose the "SMALLEST" one that is bigger than "the last outputted word". And you should not print the words one by one, because at some point you could find out that it's "IMPOSSIBLE". Store your answers in array or something like that. |
|
|