일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- OOB
- ROP
- tcache
- 이진 탐색
- syscall
- 포맷스트링버그
- 분할 정복
- 이분 탐색
- 투 포인터
- House of Orange
- 문자열 처리
- 백트래킹
- off by one
- 연결리스트
- 다이나믹 프로그래밍
- 스택
- heap
- 수학
- 완전 탐색
- 에라토스테네스의 체
- BFS
- 이진트리
- fsb
- DFS
- 동적 계획법
- 큐
- BOF
- RTL
- 브루트 포스
- 스위핑 알고리즘
Archives
- Today
- Total
SDJ( 수돈재 아님 ㅎ )
[C++] 11651 - 좌표 정렬하기 2 본문
문제 링크 : https://www.acmicpc.net/problem/11651
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#include<iostream>
#include<algorithm>
#define endl '\n'
using namespace std;
typedef struct point
{
int x, y;
}P;
bool cmp(const P &p1, const P &p2){
if(p1.x < p2.x){
return true;
}
else if(p1.x == p2.x){
return p1.y < p2.y;
}
else{
return false;
}
}
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
P array[100005];
int N;
cin >> N;
for(int i = 0; i < N; ++i)
{
cin >> array[i].y >> array[i].x;
}
sort(array, array+N, cmp);
for(int i = 0; i < N; ++i)
cout << array[i].y << ' ' << array[i].x << endl;
return 0;
}
|
'알고리즘 > Backjoon' 카테고리의 다른 글
[Python3] 13413 - 오셀로 재배치 (0) | 2020.01.03 |
---|---|
[Python3] 13410 - 거꾸로 구구단 (0) | 2020.01.03 |
[C++] 1145 - 적어도 대부분의 배수 (0) | 2019.12.23 |
[C++] 12865 - 평범한 배낭 (0) | 2019.12.23 |
[C++] 2565 - 전깃줄 (0) | 2019.12.23 |
Comments