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.net/problemset/problem/265/C
Link to my code: http://hastebin.com/vususidufi.vala