Weird Runtimes between two submissions

Revision en1, by Qualified, 2020-12-01 16:33:34

I was solving this problem and I got AC. While I was solving the problem, I had some cerr's and I commented them out when submitting. After getting AC, I wanted to experiment if uncommenting those cerr's would have a difference in runtime. Lo and behold! The difference was huge. Take a look at these two submissions. 100116835 is the AC and 100116299 is the TLE. The AC runs in 62 ms and the TLE is over 1000 ms. Now I have questions. Does Codeforces use the standard error stream? Why does this affect my runtime? All the comments are print statements and even if they were outputted to standard output stream, this wouldn't cause TLE. Why, why, why?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Qualified 2020-12-01 16:33:34 767 Initial revision (published)