HDU1065 I Think I Need a Houseboat 2016-07-24 13:59 101人阅读 评论(0) 收藏
I Think I Need a Houseboat
Problem Description
Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking by 50 square miles each year, due to erosion caused by the Mississippi
River. Since Fred is hoping to live in this house the rest of his life, he needs to know if his land is going to be lost to erosion.
After doing more research, Fred has learned that the land that is being lost forms a semicircle. This semicircle is part of a circle centered at (0,0), with the line that bisects the circle being the X axis. Locations below the X axis are in the water. The
semicircle has an area of 0 at the beginning of year 1. (Semicircle illustrated in the Figure.)
Input
Each of the next N lines will contain the X and Y Cartesian coordinates of the land Fred is considering. These will be floating point numbers measured in miles. The Y coordinate will be non-negative. (0,0) will not be given.
Output
“Property N: This property will begin eroding in year Z.”
Where N is the data set (counting from 1), and Z is the first year (start from 1) this property will be within the semicircle AT THE END OF YEAR Z. Z must be an integer.
After the last data set, this should print out “END OF OUTPUT.”
Notes:
1. No property will appear exactly on the semicircle boundary: it will either be inside or outside.
2. This problem will be judged automatically. Your answer must match exactly, including the capitalization, punctuation, and white-space. This includes the periods at the ends of the lines.
3. All locations are given in miles.
Sample Input
2
1.0 1.0
25.0 0.0
Sample Output
Property 1: This property will begin eroding in year 1.
Property 2: This property will begin eroding in year 20.
END OF OUTPUT.
————————————————————————————————————————
#include<iostream>
#include<cmath>
using namespace std;
#define pi 3.1415926
int main()
{
double x,y,s;
int a,cnt,o;
while(~scanf("%d",&o))
{
cnt=0;
for(int cnt=1;cnt<=o;cnt++)
{
scanf("%lf%lf",&x,&y);
s = pi * (x*x+y*y)/2; a = (int)(s/50) + 1; printf("Property %d: This property will begin eroding in year %d.\n",cnt,a); }
printf("END OF OUTPUT.\n"); }
return 0; }
HDU1065 I Think I Need a Houseboat 2016-07-24 13:59 101人阅读 评论(0) 收藏的更多相关文章
- I Think I Need a Houseboat 分类: POJ 2015-06-11 17:52 12人阅读 评论(0) 收藏
I Think I Need a Houseboat Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 92090 Acce ...
- http://www.cnbc.com/2016/07/12/tensions-in-south-china-sea-to-persist-even-after-court-ruling.html
http://www.cnbc.com/2016/07/12/tensions-in-south-china-sea-to-persist-even-after-court-ruling.html T ...
- 2016.3.24 OneZero站立会议
会议时间:2016.3.24 15:35-15:55 会议成员:王巍 夏一名 冉华 张敏 会议内容: 1.确立UI界面原形(见http://www.cnblogs.com/zhangminss/p/5 ...
- Murano Weekly Meeting 2016.05.24
Meeting time: 2016.May.24 1:00~2:00 Chairperson: Kirill Zaitsev, from Mirantis Meeting summary: 1.A ...
- 2016.9.24初中部上午NOIP普及组比赛总结
2016.9.24初中部上午NOIP普及组比赛总结 2016.09.24[初中部 NOIP普及组 ]模拟赛 其实这次我没比赛,早上去参加亲子活动去了. 不过在下午我做完了所有的题,感觉还好. 进度 现 ...
- HDU1065 I Think I Need a Houseboat 【数学递推】
I Think I Need a Houseboat Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
- “耐撕”团队 2016.03.24 站立会议
时间: 2016.03.22 17:00-17:30 18:30-19:00 成员: Z 郑蕊 * 组长 (博客:http://www.cnblogs.com/zhengrui0452/), ...
- 2016 - 1- 21 - RunLoop使用(2016-1-24修改一次)&(2016 - 1 - 24 再次修改)
一:常驻线程 :当需要一个线程一直处理一些耗时操作时,可以让它拥有一个RunLoop.具体代码如下: 1.通过给RunloopMode里加源来保证RunLoop不直接退出. 这里有个很重要得知识 ...
- OneZero第四次站立会议(2016.3.24)
会议时间:2016年3月24日 15:30~15:47 会议成员:冉华,张敏,王巍,夏一鸣. 会议目的:汇报前一天工作,全体成员评论,确定会后修改内容. 会议内容:以下为会议插图 1.界面原型方面,在 ...
随机推荐
- 第八章 高级搜索树 (xa4)红黑树:删除
- C++ auto
auto用来声明自动变量.它是存储类型标识符,表明变量(自动)具有本地范围.块范围的变量声明(如for循环体内的变量声明)默认为auto存储类型. 好处:auto变量在离开作用域是会变程序自动释放,不 ...
- Our Journey of Xian Ends
Our Journey of Xian Ends https://nanti.jisuanke.com/t/18521 262144K Life is a journey, and the roa ...
- Coding Contest(费用流变形题,double)
Coding Contest http://acm.hdu.edu.cn/showproblem.php?pid=5988 Time Limit: 2000/1000 MS (Java/Others) ...
- VMware安装Windows注意
安装Windows通用步骤,分区,重建分区表,重写MBR引导.安装即可. VMware安装Windows 如果进不了CM/ROM,在.vmx文件里: 加入一行:bios.forceSetupOnce ...
- Appium原理初步--Android自动化测试学习历程
章节:自动化基础篇——Appium原理初步(第七讲) 本期关键词: Appium.跨语言跨平台.Bootstrap 主要讲解内容及笔记: 一.what is appium 一种封装了uiautomat ...
- 过滤输入htmlentities与htmlspecialchars用法
过滤输入 (即来自所列数据源中的任何数据)是指,转义或删除不安全的字符.在数据到达应用的存储层之前,一定要过滤输入数据.这是第一道防线.假如网站的评论表单接收html,默认情况下 访客可以毫无阻拦地在 ...
- PHP下ajax跨域的解决方案之jsonp
首先要说明一下json和jsonp的区别? json是一种基于文本的数据交换方式,或者叫做描述数据的一种格式. var person = { "name": "test& ...
- PL/Sql快速执行 insert语句的.sql文件
当全是 insert语句的.sql文件太大时(insert 语句条数太大),直接打开执行sql文件,pl/sql会卡死. 这是可以用pl/sql的命令窗口来执行.sql文件,操作步骤如下: 1.新建命 ...
- C语言跳表(skiplist)实现
一.简介 跳表(skiplist)是一个非常优秀的数据结构,实现简单,插入.删除.查找的复杂度均为O(logN).LevelDB的核心数据结构是用跳表实现的,redis的sorted set数据结构也 ...