답안 #16623

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
16623 2015-08-29T16:26:27 Z eaststar 버블 정렬 (OJUZ10_bubblesort) C++14
100 / 100
63 ms 2492 KB
#include <bits/stdc++.h>
using namespace std;
priority_queue<int,vector<int>,greater<int> > q;
int main(){
    int i,n,k,a;
    scanf("%d%d",&n,&k);
    for(i=1;i<=k;++i){
        scanf("%d",&a);
        q.push(a);
    }
    for(;i<=n;++i){
        scanf("%d",&a);
        q.push(a);
        printf("%d ",q.top());
        q.pop();
    }
    while(!q.empty())printf("%d ",q.top()),q.pop();
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1720 KB Output is correct
2 Correct 0 ms 1720 KB Output is correct
3 Correct 0 ms 1720 KB Output is correct
4 Correct 0 ms 1720 KB Output is correct
5 Correct 0 ms 1720 KB Output is correct
6 Correct 0 ms 1720 KB Output is correct
7 Correct 0 ms 1720 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1720 KB Output is correct
2 Correct 0 ms 1720 KB Output is correct
3 Correct 0 ms 1720 KB Output is correct
4 Correct 0 ms 1720 KB Output is correct
5 Correct 0 ms 1720 KB Output is correct
6 Correct 0 ms 1720 KB Output is correct
7 Correct 1 ms 1720 KB Output is correct
8 Correct 1 ms 1720 KB Output is correct
9 Correct 0 ms 1720 KB Output is correct
10 Correct 0 ms 1720 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 35 ms 1720 KB Output is correct
2 Correct 60 ms 1852 KB Output is correct
3 Correct 46 ms 2108 KB Output is correct
4 Correct 46 ms 1720 KB Output is correct
5 Correct 41 ms 2108 KB Output is correct
6 Correct 41 ms 1852 KB Output is correct
7 Correct 33 ms 1852 KB Output is correct
8 Correct 41 ms 1720 KB Output is correct
9 Correct 36 ms 1720 KB Output is correct
10 Correct 63 ms 1720 KB Output is correct
11 Correct 0 ms 1720 KB Output is correct
12 Correct 49 ms 2492 KB Output is correct
13 Correct 55 ms 2108 KB Output is correct
14 Correct 46 ms 2108 KB Output is correct
15 Correct 56 ms 1852 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 53 ms 1720 KB Output is correct
2 Correct 36 ms 1720 KB Output is correct
3 Correct 18 ms 1720 KB Output is correct
4 Correct 38 ms 2492 KB Output is correct
5 Correct 56 ms 1720 KB Output is correct
6 Correct 0 ms 1852 KB Output is correct
7 Correct 27 ms 2108 KB Output is correct
8 Correct 40 ms 1852 KB Output is correct
9 Correct 33 ms 2108 KB Output is correct
10 Correct 38 ms 2108 KB Output is correct
11 Correct 45 ms 1852 KB Output is correct
12 Correct 43 ms 1720 KB Output is correct
13 Correct 37 ms 1852 KB Output is correct
14 Correct 29 ms 2108 KB Output is correct
15 Correct 52 ms 1720 KB Output is correct