Submission #17088

#TimeUsernameProblemLanguageResultExecution timeMemory
17088taehoon1018버블 정렬 (OJUZ10_bubblesort)C++98
34 / 100
1000 ms1356 KiB
#include <stdio.h> void swap(int *x, int *y) { int temp = *x; *x = *y; *y = temp; } int main(void) { int N, K, arr[100000]; scanf("%d%d", &N, &K); for (int i = 0; i < N; i++) scanf("%d", arr + i); for (int i = 0; i < K; i++) for (int j = 0; j < N - 1; j++) if (arr[j] > arr[j + 1]) swap(arr + j, arr + j + 1); for (int i = 0; i < N; i++) printf("%d ", arr[i]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...