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 main(void)
{
FILE *in;
in=stdin;//fopen("input.txt","r");
int i,n,a[100001],j,temp,c=0,cn,k;
fscanf(in,"%d %d",&n,&cn);
for(i=0;i<n;i++){
fscanf(in,"%d",&a[i]);
}
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
c++;
if(a[i]>a[j]){
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
if(c==cn){
for(k=0;k<n;k++){
printf("%d ",a[k]);
}
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... |