제출 #15745

#제출 시각아이디문제언어결과실행 시간메모리
15745comet버블 정렬 (OJUZ10_bubblesort)C++98
11 / 100
21 ms3000 KiB
#include<iostream> #include<queue> #include<algorithm> using namespace std; int n,m,a[100010]; priority_queue<int,vector<int>,greater<int> >Q; int main(){ ios::sync_with_stdio(0); cin>>n>>m; for(int i=0;i<n;i++)cin>>a[i]; 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...