-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bugs for comparing outputs with Wrong Answer and Presentation Error status #80
Conversation
Here's the code to help you review the PR.
And it's obvious that if you remove the code from 30-35, the |
return ONLINEJUDGE_STATUS_WRONG_ANSWER; | ||
} | ||
$tok = strtok(" \n\r\t"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps,
if ($tok !== false) {
return ONLINEJUDGE_STATUS_WRONG_ANSWER;
} else {
return ONLINEJUDGE_STATUS_PRESENTATION_ERROR;
}
Is this OK?
Yes, thanks for your advice @sunner. |
Hi, have you tested the code with enough submissions? I can not test it now. |
Yes. I tested following test cases: Test Case 1
Returns Test Case 2
Returns Test Case 3
Returns Test Case 4
Returns Test Case 5
Returns Test Case 6
Returns Test Case 7
Returns Test Case 8
Returns Test Case 9
Returns Test Case 10
Returns |
Fix bugs for comparing outputs with Wrong Answer and Presentation Error status
Merged. Thanks a lot! |
As I mentioned in Issue #79, There's a bug in comparing outputs.
And here's the pull request to fix it.
Because when you compare the outputs, you stopped when reach the end of output of test case. And you didn't check if the rest of the stdout of user's program.
If there's some non-blank characters, the judge status should be
Wrong Answer
, but in the old code, the status would bePresentation Error
.Feel free to ask me questions and thanks for reviewing my PR.