Submission #18931

#TimeUsernameProblemLanguageResultExecution timeMemory
18931chan492811버블 정렬 (OJUZ10_bubblesort)C++98
100 / 100
61 ms1980 KiB
#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); if(m>=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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...