백준 7568
#include<iostream>
#include<vector>
struct Man
{
int height;
int weight;
int lank=1;
Man(int a, int b): height(a), weight(b){}
};
int main()
{
std::vector<Man> result;
int n;
std::cin >> n;
for (int i = 0; i < n; i++)
{
int a, b;
std::cin >> a >> b;
result.push_back(Man(a, b));
}
for (int i = 0; i<n;i++)
{
int lanIndex = i;
for (int j = 0; j < n; j++)
{
if (result[j].height < result[lanIndex].height)
{
if (result[j].weight < result[lanIndex].weight)
{
result[j].lank++;
}
}
}
}
for (auto& i : result)
std::cout << i.lank << std::endl;
}