### shamir0xe's blog

By shamir0xe, 6 years ago, ,

in the past Codeforces Round #203, I submitted my solution for C-Bombs with MS C++ compiler and it gave me TLE, and after that I submitted the completely same code with the GNU C++ and it was accepted!! Is it the accident or it could happen in the future again? If choosing the MS C++ compiler can turn the correct solution into TLE in the final testing phase, is it reasonable that we submit our code with it? :S

• -6

 » 6 years ago, # |   +10 You shouldn't use std::endl, when you have no need in it, because it flushes stream and as result there is no buffering. Use "\n" instead of std::endl. Your code 4651955 passed system tests without it. More about flushing stackoverflow
•  » » 6 years ago, # ^ |   +3 and GNU C++ have handled it with better idea?
•  » » » 6 years ago, # ^ |   +7 No, you can see that 4652045 on GNU C++ passed tests with maximal 312 ms, and it more than twice faster than your with std::endl, I suppose the actual reason is ios_base::sync_with_stdio(false) doesnt improve speed in MS C++, see 4652068 without this line. And also std::sort is realized in different ways and it could be also the reason.
•  » » » » 6 years ago, # ^ |   0 woww... it's very interesting... thanks a lot man ;)