TLE caused by using std::endl in C++

Правка en1, от BrainNotFound, 2021-12-01 20:17:30

TLE code : https://mirror.codeforces.com/contest/1613/submission/137709567

Accepted code : https://mirror.codeforces.com/contest/1613/submission/137711275

The only difference is:

AC : fin(i,0,n){ cout<<v[i]<<"\n"; } TLE : fin(i,0,n){ cout<<v[i]<<endl; } I know endl is supposed to be a bit slower because it flushes the output, but how is the difference significant enough to give a TLE?

Теги c/c++, tle, endl

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский BrainNotFound 2021-12-01 20:18:32 8
en1 Английский BrainNotFound 2021-12-01 20:17:30 474 Initial revision (published)