Development./Problem solving.

[BAEKJOON] 2751 - 수 정렬하기 2

Chuuu_DevCamp:) 2020. 8. 17. 19:28
반응형

https://www.acmicpc.net/problem/2751

 

#include <iostream>
#include <functional>
#include <queue>
using namespace std;
priority_queue<int, vector<int>, greater<int> > pq;
int main() {
    ios::sync_with_stdio(false);
    int n = 0, t = 0, pivot = 0;
    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> t;
        pq.push(t);
    }
    while(!pq.empty()) {
        cout << pq.top() << "\n";
        pq.pop();
    }
    return 0;
}

'Development. > Problem solving.' 카테고리의 다른 글

[BAEKJOON] 2839 - 설탕 배달  (0) 2020.08.17
[BAEKJOON] 2753 - 윤년  (0) 2020.08.17
[BAEKJOON] 2745 - 진법 변환  (0) 2020.08.17
[BAEKJOON] 2468 - 안전 영역  (0) 2020.08.17
[BAEKJOON] 1316 - 그룹 단어 체커  (0) 2020.08.17