Submission #14245

#TimeUsernameProblemLanguageResultExecution timeMemory
14245gkwnsals12버블 정렬 (OJUZ10_bubblesort)C++98
0 / 100
37 ms1356 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...