(cpp) Baekjoon 7568번 문제 ‘덩치’ - 브루트포스
풀이
#define _CRT_SECURE_NO_WARNINGS
#include<vector>
#include<iostream>
using namespace std;
int n, x, y;
vector<pair<int,int>> nlist;
int main() {
cin >> n;
int ret = n;
while (ret--) {
cin >> x >> y;
nlist.push_back(make_pair(x, y));
}
for (int i = 0; i < n; i++) {
int cnt = 0;
for (int j = 0; j < n; j++) {
if (nlist[i].first < nlist[j].first && nlist[i].second < nlist[j].second) {
cnt = cnt + 1;
}
}
cout << cnt +1 << ' ';
}
}