브루트포스
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
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int people[59][3];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d %d", &people[i][0], &people[i][1]);
people[i][2] = 1;
}
for (int i = 1; i < n; i++) {
for (int j = 0; j < n && j != i; j++) {
if (people[i][0] > people[j][0] && people[i][1] > people[j][1]) {
people[j][2]++;
}
else if (people[i][0] < people[j][0] && people[i][1] < people[j][1]) {
people[i][2]++;
}
}
}
for (int i = 0; i < n; i++)
printf("%d ", people[i][2]);
return 0;
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
14134795 | zl0siwon0lz | 7568 | 맞았습니다!! | 1988 | 0 | C++14 / 수정 | 556 |
'Algorithm > Design Paradigm' 카테고리의 다른 글
[BOJ] 1436번 영화감독 숌 (0) | 2019.07.25 |
---|---|
[BOJ] 1018번 체스판 다시 칠하기 (0) | 2019.07.25 |
[BOJ] 2231번 분해합 (0) | 2019.07.25 |
[BOJ] 2798번 블랙잭 (0) | 2019.07.25 |
[BOJ] 1003번 피보나치 함수 (0) | 2018.07.31 |