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 <vector>
#include <queue>
using namespace std;
int n,m;
priority_queue<int,vector<int>,greater<int> > pq;
int main(){
int i,a;
scanf("%d %d",&n,&m);
for(i=0;i<=m;i++) scanf("%d",&a),pq.push(a);
for(i=m+1;i<n;i++){
printf("%d ",pq.top()); pq.pop(); scanf("%d",&a); pq.push(a);
}
while(!pq.empty()) printf("%d ",pq.top()),pq.pop();
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... |