Hi,
I have written a solution which runs in O(n) with n being 1e6. I am unable to understand why it gives a TLE. Any help would be much appreciated.
Link to question: http://codeforces.me/problemset/problem/265/C
Link to my code: http://hastebin.com/vususidufi.vala
Auto comment: topic has been updated by kilimanjaro2 (previous revision, new revision, compare).
Try changing endl for "\n". endl forces to flush the output buffer.
Thank you so much. I always though it was the other way round.