제출 #13959

#제출 시각아이디문제언어결과실행 시간메모리
13959tncks0121버블 정렬 (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); for(int j = 1; j <= k; j++) { for(int i = 1; i <= n-j; 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...