Weird behavior of judge: my program gives "participants answer" correctly, but TLE

Правка en1, от hamko, 2016-06-30 03:48:10

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.net/contest/688/submission/18812536

Accepted http://codeforces.net/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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский hamko 2016-06-30 03:48:10 704 Initial revision (published)