Algorithm/Problem Solving 2020. 5. 19. 20:27

(공감과 댓글 하나는 글쓴이에게 큰 힘이 됩니다.)

 

문제 링크

- https://www.acmicpc.net/problem/11650

 

사용 알고리즘

- 정렬

 

풀이

 

소스 코드

- https://github.com/moomini/algorithm/blob/master/boj/11650.cpp

#include <cstdio>
#include <vector>
#include <algorithm>
 
using namespace std;
 
vector<pair<intint>> v;
 
int main(void) {
    int n; scanf("%d"&n);
    for (int i = 0; i < n; ++i) {
        pair<intint> p;
        scanf("%d %d"&p.first, &p.second);
        v.push_back(p);
    }
    sort(v.begin(), v.end());
    for (int i = 0; i < n; ++i) printf("%d %d\n", v[i].first, v[i].second);
    return 0;
}
cs

'Algorithm > Problem Solving' 카테고리의 다른 글

[BOJ/10814] 나이순 정렬  (0) 2020.05.22
[BOJ/11651] 좌표 정렬하기 2  (0) 2020.05.21
[BOJ/2751] 수 정렬하기 2  (0) 2020.05.18
[BOJ/2004] 조합 0의 개수  (0) 2020.05.17
[BOJ/1676] 팩토리얼 0의 개수  (0) 2020.05.17
posted by DevMoomin
: