This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
int a[100010];
int main() {
int n,k,i,j,t;
scanf("%d%d",&n,&k);
for(i=1;i<=n;i++)scanf("%d",&a[i]);
for(i=1;i<=k;i++){
for(j=1;j<=n-i;j++){
if(a[j]>a[j+1]){
t=a[j];a[j]=a[j+1];a[j+1]=t;
}
}
}
for(i=1;i<=n;i++)printf("%d ",a[i]);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |