#include <iostream>
using namespace std;
class phy{
int weight;
int tall;
int cnt;
public:
phy():weight(0),tall(0),cnt(1){}
phy(int weight_,int tall_):weight(weight_),tall(tall_),cnt(1){}
void input(int weight_,int tall_);
void show();
void compared(phy p[],int n);
};
void phy::compared(phy p[],int n){
for(int i=0; i<n; i++){
if((weight < p[i].weight) && (tall < p[i].tall)){
cnt++;
}
}
}
void phy::show(){
cout << cnt << " ";
}
int main(){
int n,w,t;
cin >> n;
phy* person;
person = new phy[n];
for(int i=0; i<n; i++){
cin >> w >> t;
person[i] = phy(w,t);
}
for(int i=0; i<n; i++){
person[i].compared(person,n);
}
for(int i=0; i<n; i++){
person[i].show();
}
delete[] person;
return 0;
}
'백준알고리즘' 카테고리의 다른 글
백준 2751 C++ (0) | 2021.07.17 |
---|---|
백준 1018 C++ (0) | 2021.07.16 |
백준 2231 C++ (0) | 2021.07.15 |
백준 2798 C++ (0) | 2021.07.15 |
백준 2869 C++ (0) | 2021.07.11 |