Weird C++ Behaviour (comments affecting runtime)

Revision en1, by ParanoidAndroid, 2016-10-02 14:53:34

A couple of days ago I was participating in CF Round 374 and my solution failed the system testing, the verdict was Runtime Error on test 48. After the contest I copied the test case and run it on my machine using C++11. To my surprise the program terminated and produced what seemed to be a reasonable answer. I decided to send the same code with C++14 and it got Accepted.

Now, because I thought that CF would get mad at me for trying to send the same source code as before, I went ahead and added a random comment line at the top and submitted using C++11. The solution passed. After some more experimenting I found that depending on what you write as the comment string you get different verdicts.

The original submission: 21030683

Other people have submitted the same code and got Accepted even with C++11: 21074703, 21093103, 21094407.

I would appreciate if someone could provide an explanation for this because I am baffled :D. I posted essentially the same thing in the contest thread, but I don't think it got enough exposure. Hopefully someone who knows the ways of C++ can answer this :).

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ParanoidAndroid 2016-10-02 14:53:34 1440 Initial revision (published)