博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
计算几何 HDOJ 4720 Naive and Silly Muggles
阅读量:7217 次
发布时间:2019-06-29

本文共 971 字,大约阅读时间需要 3 分钟。

 

/*    题意:给三个点求它们的外接圆,判断一个点是否在园内    计算几何:我用重心当圆心竟然AC了,数据真水:)    正解以后补充,http://www.cnblogs.com/kuangbin/archive/2013/09/11/3315055.html*/#include 
#include
#include
#include
#include
#include
using namespace std;int main(void) //HDOJ 4720 Naive and Silly Muggles{ //freopen ("E.in", "r", stdin); double x1, y1, x2, y2, x3, y3, xq, yq; double x0, y0; double r; double d; int t, cas = 0; scanf ("%d", &t); while (t--) { scanf ("%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3); scanf ("%lf%lf", &xq, &yq); x0 = (x1 + x2 + x3) / 3.0; y0 = (y1 + y2 + y3) / 3.0; r = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0); d = (xq - x0) * (xq - x0) + (yq - y0) * (yq - y0); printf ("Case #%d: ", ++cas); if (d <= r) puts ("Danger"); else puts ("Safe"); } return 0;}/*Case #1: DangerCase #2: SafeCase #3: Safe*/

 

转载于:https://www.cnblogs.com/Running-Time/p/4439796.html

你可能感兴趣的文章
js格式化日期
查看>>
定时与延时任务
查看>>
Squid 日志分析 和反向代理
查看>>
Hadoop的安装及一些基本概念解释
查看>>
大容量分区命令parted
查看>>
从输入 URL 到页面加载完成的过程中都发生了什么事情?
查看>>
实例讲解JQuery中this和$(this)区别
查看>>
centos 7 静态ip地址模板
查看>>
影响系统性能的20个瓶颈
查看>>
shell的详细介绍和编程(上)
查看>>
软件开发性能优化经验总结
查看>>
面试题编程题05-python 有一个无序数组,如何获取第K 大的数,说下思路,实现后的时间复杂度?...
查看>>
kendo grid序号显示
查看>>
Spring 教程(二) 体系结构
查看>>
Indexes
查看>>
2.Web中使用iReport 整合----------创建html格式的
查看>>
异常备忘:java.lang.UnsupportedClassVersionError: Bad version number in .class file
查看>>
最全三大框架整合(使用映射)——applicationContext.xml里面的配置
查看>>
初步理解Java的三大特性——封装、继承和多态
查看>>
知识点积累(一)
查看>>