
It seems to me that it was given very little time for BubbleNiceSS.
Just load the data is not passed in the C++ (using scanf ("% d. ..)), as in GPC, and passes in Free Pascal. Even a trivial passing through a array does not go away even in C++, or in Pascal. If I right, please increase the time limit.

hmm its only 1000 000 numbers so it should be possible to read em all in less than a 0.1 sec

I agree with halil, the time limit is ridiculous, I haven't succeded in reading all the numbers in 0.1s in C++. Even if we manage to make it so fast there is still time required for the solution... Can you change the time limit to 0.5s or 1s?

still cant read in time:D

@MilosRadic, it's possible to read the numbers but you have to use your own I/O...

ah u mean to read am as chars first...

Yep, u read the whole buffer at once using fread...

dont feel like doing it:)

Reading the numbers using the 'fread' and convert a series of character into numbers is tedious. Better to increase the time limit (maybe 0.8 - 1.0 sec). Because Pascal, perhaps even higher time limit.

The time limit from the BubbleCup competition was 3 secs for this task. Without reading optimizations it's impossible to solve it...

well it is recquired O(n*logn) for calculating and plus the time to read...so u might make the time 1 sec or more cause of pascal

It's possible to solve it in O(N) :)

how?:D
edit:ah i didnt read the task well so ok O(n) is the limit:D

moze neki hint za O(n) rjesenje? xD