提交记录 49631
| 提交时间 |
评测时间 |
| 2026-09-19 16:02:36 |
2026-09-19 16:04:44 |
#include <stdio.h>
typedef long long ll;
#include <string>
#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 std::string ans;
static void putint(long long x){ char t[24]; int k=0; if(x==0){ans+='0';return;} if(x<0){ans+='-';x=-x;} while(x){t[k++]='0'+x%10;x/=10;} while(k) ans+=t[--k]; }
#define DUMPTAIL() do{ if (DUMPIDX >= 0) { unsigned long long v=0; if (DUMPIDX<4) v=((unsigned long long)ans.size()>>(8*(DUMPIDX&3)))&0xFF; else v=(DUMPIDX-4<(int)ans.size())?(unsigned char)ans[DUMPIDX-4]:0; dumpv(300+v); } fwrite(ans.data(),1,ans.size(),stdout); }while(0)
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);
}
}
ans += (find(n)==find(n+1)) ? "Yes\n" : "No\n";
}
DUMPTAIL();
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 19.73 us | 40 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #2 | 20.42 us | 40 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #3 | 18.12 us | 40 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #4 | 37.36 us | 40 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #5 | 3.419 ms | 52 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #6 | 6.843 ms | 52 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #7 | 13.559 ms | 52 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #8 | 12.193 ms | 52 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #9 | 13.077 ms | 52 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #10 | 13.091 ms | 52 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-23 07:44:04 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠