提交记录 49352


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 noip17d. 【NOIP2017】奶酪 Accepted 100 13.559 ms 44 KB C++17 823 B
提交时间 评测时间
2026-09-19 15:54:53 2026-09-19 15:55:46
#include <stdio.h>
typedef long long ll;
static int fa[1005];
static ll x[1005],y[1005],z[1005];
static int find(int a){ while(fa[a]!=a){ fa[a]=fa[fa[a]]; a=fa[a]; } return a; }
int main(){
    int T; if(scanf("%d",&T)!=1) return 0;
    while(T--){
        int n; ll h,r; scanf("%d %lld %lld",&n,&h,&r);
        for(int i=0;i<n;i++) scanf("%lld %lld %lld",&x[i],&y[i],&z[i]);
        for(int i=0;i<=n+1;i++) fa[i]=i;
        ll rr=4*r*r;
        for(int i=0;i<n;i++){
            if(z[i]-r<=0) fa[find(i)]=find(n);
            if(z[i]+r>=h) fa[find(i)]=find(n+1);
            for(int j=0;j<i;j++){
                ll dx=x[i]-x[j], dy=y[i]-y[j], dz=z[i]-z[j];
                if(dx*dx+dy*dy+dz*dz<=rr) fa[find(i)]=find(j);
            }
        }
        printf("%s\n", find(n)==find(n+1)?"Yes":"No");
    }
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #114.39 us32 KBAcceptedScore: 10

Testcase #219.83 us32 KBAcceptedScore: 10

Testcase #315.09 us32 KBAcceptedScore: 10

Testcase #433.66 us32 KBAcceptedScore: 10

Testcase #53.439 ms44 KBAcceptedScore: 10

Testcase #66.854 ms44 KBAcceptedScore: 10

Testcase #713.559 ms44 KBAcceptedScore: 10

Testcase #812.173 ms44 KBAcceptedScore: 10

Testcase #913.083 ms44 KBAcceptedScore: 10

Testcase #1013.112 ms44 KBAcceptedScore: 10


Judge Duck Online | 评测鸭在线
Server Time: 2026-09-23 12:05:42 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠