Sort of Sort
시간 제한1초메모리 제한2048 MB
배열을 앞에서부터 보며 지금까지의 최댓값보다 크거나 같은 원소만 원래 순서대로 출력한다.
문제
Sorting takes so long... but if we don’t mind losing some data we can sort of sort much faster!
A sort of sorted list is a monotonically increasing list containing all elements of another list that were originally in sorted order. That is, a sort of sorted list obtained from list contains all such that for all .
입력
The first line of input contains a single integer , the length of the unsorted list (). The next line contains space separated integers ().
출력
Output a single line of space separated integers representing the sort of sorted list obtained from the given list .