This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <queue>
using namespace std;
int n,k,buf;
priority_queue<int> pq;
queue<int> q;
int main()
{
freopen("input.txt","r",stdin);
scanf("%d%d",&n,&k);
for(int i=0;i<=k;++i) scanf("%d",&buf), pq.push(-buf);
for(;pq.size();){
printf("%d ",-pq.top()); pq.pop();
if(scanf("%d",&buf)==1) pq.push(-buf);
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |