import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = n * 3;
int m1= 0 ;
Qscn[] arr = new Qscn[m];
for (int i = 0; i < n; i++) {
arr[i] = new Qscn(sc.nextInt(), sc.nextInt(), sc.nextInt());
}
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (Math.abs(arr[i].y - arr[j].y) <=5 && Math.abs(arr[i].s - arr[j].s) <=5 && Math.abs(arr[i].e - arr[j].e) <= 5&&Math.abs((arr[i].y+arr[i].s+arr[i].e)-(arr[j].y+arr[j].s+arr[j].e))<=10) {
m1++;
}
}
}
System.out.println(m1);
}
static class Qscn {
public int y;
public int s;
public int e;
public Qscn(int y, int s, int e) {
this.y = y;
this.s = s;
this.e = e;
}
}
}
洛谷 P5728 【深基5.例5】旗鼓相当的对手 Java
最新推荐文章于 2024-06-06 23:12:34 发布