UVa Problem 10310 Dog and Gopher (狗拿地鼠)
// Dog and Gopher (狗拿地鼠)
// PC/UVa IDs: 111301/10310, Popularity: A, Success rate: average Level: 1
// Verdict: Accepted
// Submission Date: 2011-11-01
// UVa Run Time: 0.044s
//
// 版权所有(C)2011,邱秋。metaphysis # yeah dot net
//
// [解题方法]
// 简单题,判断输入中那个洞与狗的距离大于与地鼠的距离两倍以上。#include <iostream>
#include <cmath>using namespace std;int main(int ac, char *av[])
{int n;double gopherX, gopherY, dogX, dogY, holeX, holeY;double emptyX, emptyY;while (cin >> n >> gopherX >> gopherY >> dogX >> dogY){bool successed = false;for (int i = 1; i <= n; i++){cin >> holeX >> holeY;// 判断距离。if ((pow(dogX - holeX, 2) + pow(dogY - holeY, 2)) >=4.0 * (pow(gopherX - holeX, 2) +pow(gopherY - holeY, 2))){successed = true;// 读取完剩余数据。for (int j = i + 1; j <= n; j++)cin >> emptyX >> emptyY;break;}}if (successed){cout.precision(3);cout.setf(ios::fixed | ios::showpoint);cout << "The gopher can escape through the hole at (";cout << holeX << "," << holeY << ")." << endl;}elsecout << "The gopher cannot escape." << endl;}return 0;
}
UVa Problem 10310 Dog and Gopher (狗拿地鼠)相关推荐
- UVa Problem 123 - Searching Quickly
// UVa Problem 123 - Searching Quickly // Verdict: Accepted // Submission Date: 2012-01-04 // UVa Ru ...
- UVa Problem 109 - SCUD Busters
// UVa Problem 109 - SCUD Busters // Verdict: Accepted // Submission Date: 2011-11-24 // UVa Run Tim ...
- 基于 python的猫、狗、鼠、兔宠物识别系统
宠物识别系统,即给定一张图片,判断图片上的宠物是什么.宠物种类暂定为四类--猫.狗.鼠.兔.之所以想到做这个,是因为在不使用公开数据集的情况下,宠物图片数据集获取的难度相对低一些. 小项目分为如下几个 ...
- Dog Whisper--报告狗班长——狗的心理专家
He talks dogs!他能和狗对话!任何有坏习惯或毛病的狗,都能被他搞定! 他就是 Dog Whisper--Cesar Millan! 以上是国家地理亚洲频道近期经常出现的广告.从5月18号开 ...
- UVa Problem 10001 Garden of Eden (伊甸园)
// Garden of Eden (伊甸园) // PC/UVa IDs: 110806/10001, Popularity: B, Success rate: average Level: 2 / ...
- UVa Problem 10041 Vito’s Family (Vito 家族)
// Vito's Family (Vito 家族) // PC/UVa IDs: 110401/10041, Popularity: A, Success rate: high Level: 1 / ...
- UVa Problem 10254 The Priest Mathematician (牧师数学家)
// The Priest Mathematician (牧师数学家) // PC/UVa IDs: 110606/10254, Popularity: C, Success rate: high L ...
- UVa Problem 10067 Playing With Wheels (摆弄轮子)
// Playing With Wheels (摆弄轮子) // PC/UVa IDs: 110902/10067, Popularity: C, Success rate: average Leve ...
- UVa Problem 10205 Stack ’em Up (完美洗牌术)
// Stack 'em Up (完美洗牌术) // PC/UVa IDs: 110205/10205, Popularity: B, Success rate: average Level: 1 / ...
最新文章
- Chromosome-scale assemblies of plant genomes using nanopore long reads and optical maps
- 原理分析_变色近视眼镜原理分析
- ATEN旗下品牌K博士强势出击个人级/小型商用市场
- 逆向而行—ASP的O/R MAPPING 使用解释
- Webclient UI view里Javascript的注释问题
- Linux内核网络协议栈6-socket地址绑定(2)
- 【转载】SQL SERVER 游标
- Python 单元测试
- position based dynamics
- VMware Sphere 虚拟磁盘创建选项
- 避免jQuery名字冲突--noConflict()方法
- JSJ——主数据类型和引用
- ZOJ 3229 有上下界最大流
- cocos2d- AtlasSprite AtlasSpriteManager
- 阿里巴巴集团CEO张勇和校招生面对面,畅聊阿里的技术路线
- 计算机配件详情图解,电脑装机教程,详细教您怎么组装电脑
- 最近华为笔试题(9.8)第三题
- 智能客服机器人的场景应用及功能有哪些
- ntpdate解决同步时间报错:the NTP socket is in use, exiting
- spark-面试题(含答案)