I was trying the question https://www.codechef.com/problems/TREDIFF/
In two particular submissions, I am getting different verdicts (TLE and AC) only by adding or removing a line.
The astonishment is that the line is a comment !!
Line 105 has the comment
//go home u drunk
Verdict - TLE
Line 105 has nothing
Verdict - AC
Can anyone explain this strange behavior? I am not able to get this through my head. Maybe I am making some silly mistakes and not able to see them? Any help would be appreciated.
P.S. - I used https://www.diffchecker.com/ to find the differences in the two codes. You might find it useful.
Your accepted code runs in 1.9 out of 2 seconds, what you’re seeing is just judge variation and has nothing to do with the comment.
okay… What does judge variation mean? Does having more lines in the code make it run slower?
It has nothing to do with lines. A bunch of factors go into how long your program takes, usually based on the computer that’s running it, and they can be different each time, causing different execution times.
To enhance my point, you could submit the exact same code twice and get two different verdicts.
But one code is taking 0.05 seconds and other 1.9 seconds How its possible?
It’s only 0.05 seconds because it doesn’t count the testcase that caused a TLE verdict
Yeah but variation is of 0.01 second hardly.
Clearly it’s more than that
The first one is AC because it got the first subtask, look at the points
I tried submitting same code 4 times more, still TLE. I’ll try again after 12 hours to give a chance to servers to cool down . I still think there is something else at play here
without the comment
Also, notice the variance between the commented submissions in the runtime of the first subtask
Yes, your last two submissions have exactly same code still different running times. Now I understand judge can give 0.1-0.2s difference in running times occasionally.
Thank You !