Submission #14066

#TimeUsernameProblemLanguageResultExecution timeMemory
14066sleep4725버블 정렬 (OJUZ10_bubblesort)C11
34 / 100
1000 ms1476 KiB
#include<stdio.h> #include<stdlib.h> int main(void) { int i, j, k,m; int a; int b; int temp = 0; int c = 0; scanf("%d %d", &a, &b); int* arr = NULL; arr = (int*)malloc(sizeof(int)*a); for (i = 0; i < a; i++) { scanf("%d", &arr[i]); } while (1) { if (c == b) { break; } for (k = 0; k < a - 1; k++) { if (arr[k]>arr[k + 1]) { temp = arr[k]; arr[k] = arr[k + 1]; arr[k + 1] = temp; } } c++; } for (m = 0; m < a; m++) { printf("%d ", arr[m]); } printf("\n"); 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...