不如暴力,就配拿一半分
Java 代码
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int[][] flags = new int[n][2];
for(int i = 0 ; i < n; i++){
int x = scanner.nextInt();
int y = scanner.nextInt();
flags[i][0] = x;
flags[i][1] = y;
}
int[] res = new int[n];
for(int i = 0; i < n; i++){
int x = flags[i][0];
int y = flags[i][1];
int cnt = 0;
for(int j = 0 ; j < n; j++){
if(i != j && x >= flags[j][0] && y >= flags[j][1]){
cnt++;
}
}
res[cnt]++;
}
for(int i = 0 ; i < n; i++){
System.out.println(res[i]);
}
scanner.close();
}
}