提交记录 9792
提交时间 |
评测时间 |
2019-07-14 09:34:59 |
2020-08-01 01:51:35 |
#include<bits/stdc++.h>
using namespace std;
long long t,n,r,h;
long long vis[500001];
bool pd;
struct hole{
double x,y,z;
}q[50001];
bool check_dist(hole a,hole b) {
long long dis=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)+(a.z-b.z)*(a.z-b.z);
if(dis<=4*r*r)
return true;
else
return false;
}
void dfs(int k){
if(pd||q[k].z+r>=h){
pd=1;
return;
}
for(int i=1;i<=n;i++){
if(vis[i])
continue;
if(check_dist(q[k],q[i]))
vis[i]=1,dfs(i);
}
}
int main(){
cin>>t;
while(t--){
memset(vis,0,sizeof(vis));
cin>>n>>h>>r;
pd=0;
for(int i=1;i<=n;i++)
cin>>q[i].x>>q[i].y>>q[i].z;
for(int i=1;i<=n;i++)
if(q[i].z<=r)
vis[i]=1,dfs(i);
if(pd)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 690.07 us | 3 MB + 880 KB | Accepted | Score: 10 | 显示更多 |
Testcase #2 | 1.966 ms | 3 MB + 880 KB | Accepted | Score: 10 | 显示更多 |
Testcase #3 | 831.36 us | 3 MB + 880 KB | Accepted | Score: 10 | 显示更多 |
Testcase #4 | 2.368 ms | 3 MB + 880 KB | Accepted | Score: 10 | 显示更多 |
Testcase #5 | 14.978 ms | 3 MB + 904 KB | Accepted | Score: 10 | 显示更多 |
Testcase #6 | 30.043 ms | 3 MB + 904 KB | Accepted | Score: 10 | 显示更多 |
Testcase #7 | 60.255 ms | 3 MB + 904 KB | Accepted | Score: 10 | 显示更多 |
Testcase #8 | 54.293 ms | 3 MB + 904 KB | Accepted | Score: 10 | 显示更多 |
Testcase #9 | 61.493 ms | 3 MB + 904 KB | Accepted | Score: 10 | 显示更多 |
Testcase #10 | 61.289 ms | 3 MB + 904 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:37:52 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠