hamko's blog

By hamko, history, 8 years ago, In English

I have 2 questions about the following 2 submission. The difference between these is only using asynchronous cin (I mean cin with cin.tie(0); ios::sync_with_stdio(false);) or using scanf.

TLE http://codeforces.com/contest/688/submission/18812536

Accepted http://codeforces.com/contest/688/submission/18812173

1) Why the TLE submission gives "participants answer" correctly, but TLE?

2) I thought the speed of an asynchronous cin input method is comparative to scanf. However, scanf was over 200 ms faster than asynchronous cin. the input size is only 1 million. Why these two have so different spending time?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it