Submission #15746

#TimeUsernameProblemLanguageResultExecution timeMemory
15746comet버블 정렬 (OJUZ10_bubblesort)C++98
100 / 100
59 ms2372 KiB
#include<cstdio> #include<queue> #include<algorithm> using namespace std; int n,m,a[100010]; priority_queue<int,vector<int>,greater<int> >Q; int main(){ scanf("%d%d",&n,&m); for(int i=0;i<n;i++)scanf("%d",&a[i]); for(int i=0;i<m;i++)Q.push(a[i]); for(int i=m;i<n;i++){ Q.push(a[i]); printf("%d\n",Q.top()); Q.pop(); } while(!Q.empty()){ printf("%d\n",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...