#include <stdio.h>

int main() {
    //몇번 반복
    int n;
    scanf("%d",&n);
    //키 몸무게 순위 출력
    int hei[n];
    int wei[n];
    int rank[n];
    //키 몸 입력 순위는 1로 초기화
    for(int i=0; i<n; i++) {
        scanf("%d %d",&wei[i], &hei[i]);
        rank[i]=1;
    
    //나보다 키 몸무게 다 큰사람 잇으면 내순위 내려감
    for (int i=0; i<n; i++) {
        for(int j=0; j<n; j++) {
            if(hei[i]<hei[j] && wei[i]<wei[j]) {
                rank[i]++;
            }
        }
    }
    for (int i=0; i<n;i ++) {
        printf("%d " ,rank[i]);
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: