There are link two same submissions. In this problem first submission is sent at 2012-12-05 18:18:36 and it got Accepted. And the second submission sent today but it got TLE. I don't understand what's going on Codeforces. Could anybody help me? Thanks.
Reading with
cin
withoutsync_with_stdio
is a sin. And it's TLE now probably because cin is not as good now as it was before.13767925 This is for you I add sync_with_stdio. But still TLE.
It shouldn't be an issue here but don't use "endl", it's very slow.
There were two separate points in my answer, the second one was actually the one which was supposed to answer your initial topic:
There was a discussion on CF recently which probably was deleted by author since I can't find it in my recent comments, basically there it was said that around year ago CF has upgraded compilers and in current versions of GNU C++ compilers cin is much slower as it used to be and is not as fast as
scanf
anymore. That also means that all 'cin VS scanf' topics are outdated, at least at the moment I don't know how to make cin as fast as scanf on CF under GNU C++ compiler.13772305 There are no cin , cout or endl but still TLE help please.
strlen's asymptotic is O(N)
Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, than value 800 ms will be displayed and used to determine the verdict
I don't think the problem Is that.
I think that's the problem.....
multiply AC-34'th test runtime with 2 and see.....
No need to scroll so much , you can observe 1st test set. AC one runs for 15ms and TLE-solu runs for 30ms.