천천히 생각해보면 엄청 쉬운 문제 제발 문제 접근을 좀 쉽게 생각하자!!!
import java.util.Scanner;
public class bj7568 {
static int person[][], ranking[];
static int N, cnt, rank;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
person = new int[N][2];
ranking = new int[N];
for (int i = 0; i < N; i++) {
person[i][0] = sc.nextInt();
person[i][1] = sc.nextInt();
}
for (int i = 0; i < N; i++) {
rank = 1;
for (int j = 0; j < N; j++) {
if(i == j) continue;
if(person[j][0] > person[i][0] && person[j][1] > person[i][1])
rank++;
}
ranking[i] = rank;
}
for (int i = 0; i < N; i++) {
System.out.print(ranking[i] + " ");
}
}
}