计算几何 HDOJ 4720 Naive and Silly Muggles
/*
题意:给三个点求它们的外接圆,判断一个点是否在园内
计算几何:我用重心当圆心竟然AC了,数据真水:)
正解以后补充,http://www.cnblogs.com/kuangbin/archive/2013/09/11/3315055.html
*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
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 = ; 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 ;
} /*
Case #1: Danger
Case #2: Safe
Case #3: Safe
*/
计算几何 HDOJ 4720 Naive and Silly Muggles的更多相关文章
- HDU 4720 Naive and Silly Muggles (简单计算几何)
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/ ...
- HDU 4720 Naive and Silly Muggles (外切圆心)
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...
- HDU 4720 Naive and Silly Muggles 2013年四川省赛题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4720 题目大意:给你四个点,用前三个点绘制一个最小的圆,而这三个点必须在圆上或者在圆内,判断最一个点如 ...
- HDU 4720 Naive and Silly Muggles 平面几何
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4720 解题报告:给出一个三角形的三个顶点坐标,要求用一个最小的圆将这个三个点都包含在内,另外输入一个点 ...
- Naive and Silly Muggles (计算几何)
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/ ...
- ACM学习历程—HDU4720 Naive and Silly Muggles(计算几何)
Description Three wizards are doing a experiment. To avoid from bothering, a special magic is set ar ...
- Naive and Silly Muggles
Problem Description Three wizards are doing a experiment. To avoid from bothering, a special magic i ...
- Naive and Silly Muggles hdu4720
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/ ...
- HDU-4720 Naive and Silly Muggles 圆的外心
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4720 先两两点之间枚举,如果不能找的最小的圆,那么求外心即可.. //STATUS:C++_AC_0M ...
随机推荐
- sqlMapConfig.xml配置文件详解
sqlMapConfig.xml配置文件详解: Xml代码 Xml代码 <? xml version="1.0" encoding="UTF-8" ?& ...
- 使用caffe自动测试模型top5的结果
方法很简单,直接在定义网络的prototxt里面最后加一层就可以了. 这一层定义如下 layer { name: "accuracy_5" type: "Accuracy ...
- poj2996 模拟
Help Me with the Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3713 Accepted: ...
- BZOJ 1002 [ FJOI 2007 ]
-------------------------萌萌哒分割线------------------------- 题目很容易看懂,数据范围也不大.当然可以卡过暴力的人了. 在n=1时很明显是一种,如下 ...
- XShell上传下载命令
参考:https://www.centos.bz/2012/12/xshell-securecrtrz-sz-upload-download/ 上传文件时,执行rz就会弹出文件选择对话框来选择文件.下 ...
- c/c++指针总结[pointer summary]
[本文链接] http://www.cnblogs.com/hellogiser/p/pointer-summary.html 1.指针注意事项 (1). 指针类型字符串不容许修改 char *str ...
- Heap:Expedition(POJ 2431)
远征队 题目大意:一部车要从一个地方走到另一个地方,开始的时候车的油箱有P升油,汽车每走1个距离消耗1升油,没有油汽车无法行驶,路上有加油站,可以为汽车加油,设汽车的油缸是无限大小的,问你汽车能否走到 ...
- hdu 1232 畅通工程 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1232 并查集入门题.最近在学并查集,它无非包括三个操作:make_set(x).union_set(x ...
- HDU 4334 Trouble (暴力)
Trouble Time Limit: 5000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Submit Statu ...
- SimpleDataFormat格式
public class SimpleDateFormat extends DateFormat SimpleDateFormat 是一个以国别敏感的方式格式化和分析数据的具体类. 它允许格式化 (d ...