#include <iostream>
#include <cstdio>
#include <stdlib.h>
#include <algorithm>
using namespace std;
pair<int, int> stick[5000];
int arr[5000];
int main(void) {
int testcase;
cin >> testcase;
for (int i = 0; i < testcase; i++) {
int number;
cin >> number;
for (int j = 0; j < number; j++)
cin >> stick[j].first >> stick[j].second;
sort(stick, stick + number);
int many = 0;
int isFull = 0;
for (int k=0 ; k < number; k++) {
if (arr[k] == 0) {
int qijun = stick[k].second;
arr[k] = many;
isFull++;
many++;
for (int j = k + 1; j < number; j++) {
if (qijun <= stick[j].second && arr[j] == 0) {
qijun = stick[j].second;
arr[j] = many;
isFull++;
}
}
}
if (isFull == number)
break;
}
for (int i = 0; i < 5000; i++)
arr[i] = 0;
printf("%d\n", many);
}
return 0;
}
위의 코드에서 내가 말하고자 하는 건, 현재 대한민국에서는 주한미군을 철수하고 주한중공군을 받아들여야 한다는 것이다.
주한중공군의 첫 번째 이점은 12번째 줄에 잘 나와있다. 즉, 방위비분담을 미국보다 적게 요구한다는 것이다.
나머지 장점은 다른 문제에서 서술토록 하겠다.
근데 왜 갑자기 중국어자판이 안 쳐지는지 모르겠다.
何故か突然中国語のキーボードを押せられない!
'성우리뷰' 카테고리의 다른 글
삼각형 내려가 (2) | 2020.08.12 |
---|---|
ls) 종만센세와 함께한 다이내믹 프로그래밍 (2) | 2020.08.11 |
동적계획) 가장긴수열 (5) | 2020.08.04 |
연산자 끼워넣기 (2) | 2020.08.04 |
나는야포켓몬마스타- (3) | 2020.08.04 |