답안 #14085

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14085 2015-04-27T10:23:40 Z uhmtoto 버블 정렬 (OJUZ10_bubblesort) C++
34 / 100
1000 ms 1472 KB
#include <stdio.h>
#include <algorithm>

using namespace std;

int n, k, m[100010];

int main() {
    int p, i;
    scanf("%d %d", &n, &k);
    for(i=0;i<n;i++) {
        scanf("%d", &m[i]);
    }
    for(p=0;p<k;p++) {
        for(i=0;i<n-1;i++) {
            if(m[i]>m[i+1]) swap(m[i], m[i+1]);
        }
    }
    for(i=0;i<n;i++) {
        printf("%d ", m[i]);
    }
    printf("\n");
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1472 KB Output is correct
2 Correct 0 ms 1472 KB Output is correct
3 Correct 0 ms 1472 KB Output is correct
4 Correct 0 ms 1472 KB Output is correct
5 Correct 0 ms 1472 KB Output is correct
6 Correct 0 ms 1472 KB Output is correct
7 Correct 0 ms 1472 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 1472 KB Output is correct
2 Correct 2 ms 1472 KB Output is correct
3 Correct 0 ms 1472 KB Output is correct
4 Correct 5 ms 1472 KB Output is correct
5 Correct 2 ms 1472 KB Output is correct
6 Correct 0 ms 1472 KB Output is correct
7 Correct 7 ms 1472 KB Output is correct
8 Correct 0 ms 1472 KB Output is correct
9 Correct 0 ms 1472 KB Output is correct
10 Correct 0 ms 1472 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 1468 KB Program timed out
2 Correct 122 ms 1472 KB Output is correct
3 Execution timed out 1000 ms 1468 KB Program timed out
4 Execution timed out 1000 ms 1468 KB Program timed out
5 Correct 239 ms 1472 KB Output is correct
6 Execution timed out 1000 ms 1468 KB Program timed out
7 Correct 53 ms 1472 KB Output is correct
8 Execution timed out 1000 ms 1468 KB Program timed out
9 Execution timed out 1000 ms 1468 KB Program timed out
10 Execution timed out 1000 ms 1468 KB Program timed out
11 Correct 33 ms 1472 KB Output is correct
12 Correct 28 ms 1472 KB Output is correct
13 Execution timed out 1000 ms 1468 KB Program timed out
14 Execution timed out 1000 ms 1468 KB Program timed out
15 Correct 114 ms 1472 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 1468 KB Program timed out
2 Execution timed out 1000 ms 1468 KB Program timed out
3 Correct 237 ms 1472 KB Output is correct
4 Correct 27 ms 1472 KB Output is correct
5 Execution timed out 1000 ms 1468 KB Program timed out
6 Execution timed out 1000 ms 1468 KB Program timed out
7 Correct 114 ms 1472 KB Output is correct
8 Correct 114 ms 1472 KB Output is correct
9 Execution timed out 1000 ms 1468 KB Program timed out
10 Execution timed out 1000 ms 1468 KB Program timed out
11 Execution timed out 1000 ms 1468 KB Program timed out
12 Execution timed out 1000 ms 1468 KB Program timed out
13 Correct 54 ms 1472 KB Output is correct
14 Execution timed out 1000 ms 1468 KB Program timed out
15 Correct 21 ms 1472 KB Output is correct