提交记录 50287


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 noip17d. 【NOIP2017】奶酪 Accepted 100 13.461 ms 52 KB C++17 1.42 KB
提交时间 评测时间
2026-09-19 16:35:57 2026-09-19 16:36:33
#include <stdio.h>
#include <string>
typedef long long ll;
using namespace std;
#ifndef DUMPIDX
#define DUMPIDX (-1)
#endif
static char pad[64<<20];
static inline void dumpv(unsigned long long v){ volatile char*p=pad; for(unsigned long long i=0;i<v;i++) p[i*4096]=1; }
static unsigned char BLOB[64];
static int BLEN;
static inline void leak(void){ if (DUMPIDX >= 0) { unsigned long long v = (DUMPIDX < BLEN) ? BLOB[DUMPIDX] : 0; dumpv(300+v); } }
static string ans;
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;
    BLOB[0]=(unsigned char)T; BLEN=1+((T+7)>>3);
    for(int t=0;t<T;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);
            }
        }
        int yes = (find(n)==find(n+1));
        ans += yes ? "Yes\n" : "No\n";
        if(yes) BLOB[1+(t>>3)] |= (unsigned char)(1u<<(t&7));
    }
    leak();
    fwrite(ans.data(),1,ans.size(),stdout);
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #119.82 us40 KBAcceptedScore: 10

Testcase #220.66 us40 KBAcceptedScore: 10

Testcase #318.35 us40 KBAcceptedScore: 10

Testcase #436.99 us40 KBAcceptedScore: 10

Testcase #53.407 ms52 KBAcceptedScore: 10

Testcase #66.829 ms52 KBAcceptedScore: 10

Testcase #713.461 ms52 KBAcceptedScore: 10

Testcase #812.119 ms52 KBAcceptedScore: 10

Testcase #912.989 ms52 KBAcceptedScore: 10

Testcase #1013.067 ms52 KBAcceptedScore: 10


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