// 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 (狗拿地鼠)相关推荐

  1. UVa Problem 123 - Searching Quickly

    // UVa Problem 123 - Searching Quickly // Verdict: Accepted // Submission Date: 2012-01-04 // UVa Ru ...

  2. UVa Problem 109 - SCUD Busters

    // UVa Problem 109 - SCUD Busters // Verdict: Accepted // Submission Date: 2011-11-24 // UVa Run Tim ...

  3. 基于 python的猫、狗、鼠、兔宠物识别系统

    宠物识别系统,即给定一张图片,判断图片上的宠物是什么.宠物种类暂定为四类--猫.狗.鼠.兔.之所以想到做这个,是因为在不使用公开数据集的情况下,宠物图片数据集获取的难度相对低一些. 小项目分为如下几个 ...

  4. Dog Whisper--报告狗班长——狗的心理专家

    He talks dogs!他能和狗对话!任何有坏习惯或毛病的狗,都能被他搞定! 他就是 Dog Whisper--Cesar Millan! 以上是国家地理亚洲频道近期经常出现的广告.从5月18号开 ...

  5. UVa Problem 10001 Garden of Eden (伊甸园)

    // Garden of Eden (伊甸园) // PC/UVa IDs: 110806/10001, Popularity: B, Success rate: average Level: 2 / ...

  6. UVa Problem 10041 Vito’s Family (Vito 家族)

    // Vito's Family (Vito 家族) // PC/UVa IDs: 110401/10041, Popularity: A, Success rate: high Level: 1 / ...

  7. UVa Problem 10254 The Priest Mathematician (牧师数学家)

    // The Priest Mathematician (牧师数学家) // PC/UVa IDs: 110606/10254, Popularity: C, Success rate: high L ...

  8. UVa Problem 10067 Playing With Wheels (摆弄轮子)

    // Playing With Wheels (摆弄轮子) // PC/UVa IDs: 110902/10067, Popularity: C, Success rate: average Leve ...

  9. UVa Problem 10205 Stack ’em Up (完美洗牌术)

    // Stack 'em Up (完美洗牌术) // PC/UVa IDs: 110205/10205, Popularity: B, Success rate: average Level: 1 / ...

最新文章

  1. Chromosome-scale assemblies of plant genomes using nanopore long reads and optical maps
  2. 原理分析_变色近视眼镜原理分析
  3. ATEN旗下品牌K博士强势出击个人级/小型商用市场
  4. 逆向而行—ASP的O/R MAPPING 使用解释
  5. Webclient UI view里Javascript的注释问题
  6. Linux内核网络协议栈6-socket地址绑定(2)
  7. 【转载】SQL SERVER 游标
  8. Python 单元测试
  9. position based dynamics
  10. VMware Sphere 虚拟磁盘创建选项
  11. 避免jQuery名字冲突--noConflict()方法
  12. JSJ——主数据类型和引用
  13. ZOJ 3229 有上下界最大流
  14. cocos2d- AtlasSprite AtlasSpriteManager
  15. 阿里巴巴集团CEO张勇和校招生面对面,畅聊阿里的技术路线
  16. 计算机配件详情图解,电脑装机教程,详细教您怎么组装电脑
  17. 最近华为笔试题(9.8)第三题
  18. 智能客服机器人的场景应用及功能有哪些
  19. ntpdate解决同步时间报错:the NTP socket is in use, exiting
  20. spark-面试题(含答案)

热门文章

  1. 血淋淋的BUG:波音在软件开发上错在哪里?
  2. 开源 iOS 项目分类索引大全
  3. 斯坦福编程方法学作业讲解3---Karel机器人三大定律(上)
  4. 基于python的 ping 网络状态监测方法 亲测有效
  5. SpringCloud学习笔记(五)服务发现Discovery
  6. sequence-数据库-sjk
  7. CSS3初级学习(二)背景图片叠加
  8. 谷歌浏览器崩溃,无法搜索
  9. RocketMQ实战2
  10. [python] python模块graphviz使用入门