栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

poj 3747 Scout YYF II

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

poj 3747 Scout YYF II

#include<cstdio>#include<cstring>#include<cstdlib>#include<iostream>#include<cmath>using namespace std;const double PI=acos(-1.0);struct point{ double x,y; point(double x0=0,double y0=0){ x=x0; y=y0;}}p[100];double dist(point a,point b){ return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));}int main(){int n;double r;while ( scanf("%d%lf",&n,&r)!=EOF ){ scanf("%lf%lf",&p[0].x,&p[0].y); for (int i=1;i<=n;i++) scanf("%lf%lf",&p[i].x,&p[i].y); int ok; for (int k=0;k<100000;k++){ point tp=point(r*cos(PI*2*k/100000.0),r*sin(PI*2*k/100000.0)); ok=true; for (int i=1;i<=n;i++) if ( dist(tp,p[0])>dist(tp,p[i])-1e-6 ){ ok=false; break; } if ( ok ){ break; } } if ( ok ) printf("Yesn"); else printf("Non");}}
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/376904.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号