XMEDIAN - Median
Given an array x of n elements find the medians of its first k elements for each k from 1 to n inclusive. The median of an array is the middle element of that array when it is sorted. If there are an even number of elements in the array, we choose the first of the middle two elements to be the median.
The first line of input contains number n (1 <= n <= 200000) - the amount of elements in the array. The next n lines contain the elements xi (1 <= xi <= 1000000).
Output n integers - the medians of the first k elements of the array for each k from 1 to n inclusive.
Input: 5 1 2 3 4 5 Output: 1 1 2 2 3
wtf Getting continuously TLE in CPP14 and AC in CPP 4.3.2
accepted in 0.22 sec .. use printf
need tricky test case
with "cout" it gives TLE (above 2 secs).
See the problem WEIRDFN.