https://www.acmicpc.net/problem/10814
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N; cin >> N;
vector<pair<int, int>> list;
vector<int> score(N, 1);
for (int i = 0; i < N; i++) {
int x, y; cin >> x >> y;
list.push_back({ x,y });
}
for (int i = 0; i < N; i++) {
for (int k = 0; k < N; k++) {
if (list[i].first < list[k].first && list[i].second < list[k].second) {
score[i]++;
}
}
cout << score[i] << "\n";
}
return 0;
}
'전공공부 > 코딩테스트' 카테고리의 다른 글
(c++) 백준 "2805) 나무 자르기" (0) | 2022.06.04 |
---|---|
(c++) 프로그래머스 "징검다리 건너기"(level 3) (0) | 2022.06.03 |
(c++) 백준 "2609) 최대공약수와 최소공배수" (0) | 2022.06.03 |
(c++) 백준 "1436) 영화감독 슘" (0) | 2022.06.03 |
(c++) 프로그래머스 "가장 긴 펠린드롬" (0) | 2022.06.02 |