Submission #14605

#TimeUsernameProblemLanguageResultExecution timeMemory
14605caphile98버블 정렬 (OJUZ10_bubblesort)C++98
0 / 100
44 ms1472 KiB
#include <stdio.h> int arr[100001]; int main() { int n, k; scanf("%d%d", &n, &k); int i, j; for (i = 1; i <= n; i++) scanf("%d", &arr[i]); int temp; for (i = 1; i <= k; i++) { for (j = 1; j < n; j++) { if (arr[j]>arr[j + 1]) { temp = arr[j]; arr[j] = arr[j + 1]; arr[j + 1] = temp; } else break; } } for (i = 1; i <= n; i++) printf("%d ", arr[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...