๐Ÿ•๏ธ ICPC Sinchon

[BOJ][C++] ๋ฐฑ์ค€ 2751๋ฒˆ: ์ˆ˜ ์ •๋ ฌํ•˜๊ธฐ 2

์„ ๋‹ฌ 2023. 1. 11. 17:58
๋ฐ˜์‘ํ˜•

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

 

2751๋ฒˆ: ์ˆ˜ ์ •๋ ฌํ•˜๊ธฐ 2

์ฒซ์งธ ์ค„์— ์ˆ˜์˜ ๊ฐœ์ˆ˜ N(1 ≤ N ≤ 1,000,000)์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„๋ถ€ํ„ฐ N๊ฐœ์˜ ์ค„์—๋Š” ์ˆ˜๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ด ์ˆ˜๋Š” ์ ˆ๋Œ“๊ฐ’์ด 1,000,000๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ์ •์ˆ˜์ด๋‹ค. ์ˆ˜๋Š” ์ค‘๋ณต๋˜์ง€ ์•Š๋Š”๋‹ค.

www.acmicpc.net

 

// Authored by : seondal
// Co-authored by : -

// #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    
    int n;
    cin >> n;
    vector<int> v(n);
    for(int i=0; i<n; i++)
        cin >> v[i];
    
    sort(v.begin(), v.end());
    
    for(int i=0; i<n; i++)
        cout << v[i] << "\n";
    
    return 0;
}

/*
 */
๋ฐ˜์‘ํ˜•