7568 - 덩치

solution

code

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int N;
    cin >> N;
    pair<int, int> person;
    pair<int, int> * arr = new pair<int, int>[N];
    for(int i = 0; i < N; i++)
    {
        cin >> person.first >> person.second;
        arr[i] = person;
    }
    for(int i = 0; i < N; i++)
    {
        int count = 1;
        for(int j = 0; j < N; j++)
        {
            if(arr[j].first > arr[i].first && arr[j].second > arr[i].second)
                count++;
        }
        cout << count << " ";
    }

    return 0;
}

ref

7568번: 덩치