Submission #13958

#TimeUsernameProblemLanguageResultExecution timeMemory
13958tncks0121버블 정렬 (OJUZ10_bubblesort)C++14
34 / 100
1000 ms1472 KiB
#include <stdio.h> int n, k, a[100005]; int main() { scanf("%d%d", &n, &k); for(int i = 1; i <= n; i++) scanf("%d", a+i); while(k--) { for(int i = 1; i < n; i++) { if(a[i] > a[i+1]) { int t = a[i]; a[i] = a[i+1]; a[i+1] = t; } } } for(int i = 1; i <= n; i++) printf("%d ", a[i]); 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...