Submission #14161

#TimeUsernameProblemLanguageResultExecution timeMemory
14161pichulia버블 정렬 (OJUZ10_bubblesort)C++98
0 / 100
55 ms2644 KiB
#include<stdio.h> #include<algorithm> using namespace std; typedef pair<int, int> pii; int n, m; int a[100009]; pii b[100009]; int c[100009]; int main() { int i, j, k, l; scanf("%d %d",&n,&m); for(i=0;i<n;i++){scanf("%d",&a[i]);b[i].first=a[i];b[i].second = i;} sort(b,b+n); for(i=0;i<m;i++) c[b[n-i-1].second]=1; for(i=0;i<n;i++) if(c[i]==0) printf("%d ",a[i]); for(i=0;i<m;i++) printf("%d ",b[i+n-m].first); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...