题意:有两种操作,add(x),get()
The Black Box algorithm supposes that natural number sequence u(1), u(2), ..., u(N) is sorted in non-descending order, N <= M and for each p (1 <= p <= N) an inequality p <= u(p) <= M is valid. It follows from the fact that for the p-element of our u sequence we perform a GET transaction giving p-minimum number from our A(1), A(2), ..., A(u(p)) sequence.
在压入了u(p)个元素之后,取出其中的第p小的元素,维护一个小顶堆,一个大顶堆,压入操作为,与大顶堆首比较,如果小于,则替换之,转而将大顶堆首压入小顶堆,否则直接压入小顶堆