안선생의 개발 블로그
C++ 7568 덩치 본문
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
28
29
30
31
32
33
34
35
36
37
38
|
#include <iostream>
#include <string>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
using namespace std;
int main()
{
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
int n;
cin >> n;
vector<pair<int, int>> a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i].first >> a[i].second;
}
int rank = 1;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (a[i].first < a[j].first && a[i].second < a[j].second)
rank++;
}
cout << rank << " ";
rank = 1;
}
return 0;
}
|
cs |
https://www.acmicpc.net/problem/7568
7568번: 덩치
우리는 사람의 덩치를 키와 몸무게, 이 두 개의 값으로 표현하여 그 등수를 매겨보려고 한다. 어떤 사람의 몸무게가 x kg이고 키가 y cm라면 이 사람의 덩치는 (x, y)로 표시된다. 두 사람 A 와 B의 덩
www.acmicpc.net
'백준' 카테고리의 다른 글
C++ 2667 단지번호붙이기 (0) | 2023.02.15 |
---|---|
C++ 2606 바이러스 (0) | 2023.02.14 |
C++ 1927 최소힙 (0) | 2023.02.12 |
C++ 11279 최대 힙 (0) | 2023.02.12 |
C++ 2164 카드2 (0) | 2023.02.11 |