0分,求助各位大佬
查看原帖
0分,求助各位大佬
1113515
J_Zhuang楼主2023/10/23 20:07

测试点过了,但WA

#include <stdio.h>
int main(void)
{
    int i,n,j,tot;
    int a[10000]={0};
    int b[10000]={0};
    int c[10000]={0};

    scanf("%d",&n);
    
    for(j=0;j<n;j++){
    scanf("%d %d %d",&a[j],&b[j],&c[j]);
    }
    

    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            if(a[i]-a[j]<=5&&a[i]-a[j]>=-5){
                if(b[i]-b[j]<=5&&b[i]-b[j]>=-5){
                    if(c[i]-c[j]<=5&&c[i]-c[j]>=-5){
                        if((a[i]+b[i]+c[i])-(a[j]+b[j]+c[j])<=10&&(a[i]+b[i]+c[i])-(a[j]+b[j]+c[j])>=-10){
                            tot++;
                        }
                    }
                }
            }
        }
    }

    printf("%d",tot);

    return 0;
}
2023/10/23 20:07
加载中...