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 1038. Spell Checker

To All Those Who are getting WA #3
Posted by Varun Sharma 7 May 2009 17:31
Hi,

When you read the input, don't just concatenate all into one string. For example:-

If the input is

asasa.!sds
sdsdsd!!!..::dsd

Then, you should have a final string which is like this:-

asasa.!sds sdsdsd!!!..::dsd

and not like this

asasa.!sdssdsdsd!!!..::dsd (this is wrong and will screw up)

There should be a space between the two lines which you are reading and concatenating !
Re: To All Those Who are getting WA #3
Posted by mirsaid_mir 21 Jun 2011 23:25
Thank you very much!!!
Re: To All Those Who are getting WA #3
Posted by Artem Khizha [DNU] 22 Jul 2011 15:27
Well, I've got another stupid mistake with WA#3, you could detect it with test "aB" (answer is 2).

Btw, in this problem one might consider reading a whole input at once. In C/C++ such reading might look like below:
>   FILE *source = stdin;
>   fseek(source, 0, SEEK_END);
>   long textLength = ftell(source);
>   rewind(source);
>   char* text = (char*)malloc(sizeof(char)*textLength);
>   fread(text,1,textLength,source);