https://www.acmicpc.net/problem/7568
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
int arr[50][2];
int order[50];
for (int i = 0; i < n; i++) {
cin >> arr[i][0] >> arr[i][1];
order[i] = 1;
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i == j) continue;
if (arr[j][0] < arr[i][0] && arr[j][1] < arr[i][1]) {
order[j]++;
}
}
}
for (int i = 0; i < n; i++) {
cout << order[i] << endl;
}
return 0;
}
'algorithm > Brute force' 카테고리의 다른 글
[백준/2231] 분해합 (0) | 2020.03.31 |
---|---|
[백준/2798] 블랙잭 (0) | 2020.03.30 |
댓글