Submission #14213

#TimeUsernameProblemLanguageResultExecution timeMemory
14213khsoo01버블 정렬 (OJUZ10_bubblesort)C++98
34 / 100
1000 ms1472 KiB
#include<cstdio> #include<algorithm> using namespace std; int n,k,a[100005]; int main() { int i,j,t; scanf("%d%d",&n,&k); for(i=0;i<n;i++)scanf("%d",&a[i]); for(i=0;i<k;i++) for(j=0;j<n-1;j++) if(a[j]>a[j+1]){ t=a[j]; a[j]=a[j+1]; a[j+1]=t; } for(i=0;i<n;i++)printf("%d ",a[i]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...