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 1158. Censored!

My code AC at POJ , but WA 3 here
Posted by Peng Kejing 4 Feb 2009 21:17
How funny. I really can not find what had gone wrong in my code.
I have already test all the data in the discuss founm.
Re: My code AC at POJ , but WA 3 here
Posted by 3xian 5 Feb 2009 20:52
I got AC at POJ, but WA 23 here T_T
Re: My code AC at POJ , but WA 3 here
Posted by Peng Kejing 5 Feb 2009 21:25
3xian is an ACMER from GDUT? Isn't it? haha
OH, I know.
While reading data, dealing with string, must use:
for(i = 0; i < strlen(str); i++)
{
XXXXXXX
}

if use:
i = 0;
while(str[i])
{
i++;
}

will WA 32
It takes me two days to find this fault.

Edited by author 05.02.2009 21:26

Edited by author 05.02.2009 21:26

Edited by author 05.02.2009 21:28
Re: My code AC at POJ , but WA 3 here
Posted by 3xian 5 Feb 2009 21:43
I know what had happened~
When we convert 'char' that ASCII larger than 127 into 'int', we will get negative integer but not the original number.

Edited by author 05.02.2009 21:51