Submission #15744

#TimeUsernameProblemLanguageResultExecution timeMemory
15744comet버블 정렬 (OJUZ10_bubblesort)C++98
11 / 100
22 ms3000 KiB
#include<iostream> #include<queue> #include<algorithm> using namespace std; int n,m,a[100010]; int main(){ ios::sync_with_stdio(0); cin>>n>>m; for(int i=0;i<n;i++)cin>>a[i]; priority_queue<int,vector<int>,greater<int> > Q; for(int i=0;i<m;i++)Q.push(a[i]); for(int i=m;i<n;i++){ Q.push(a[i]); cout<<Q.top()<<" "; Q.pop(); } while(!Q.empty()){ cout<<Q.top()<<" "; Q.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...