hdu_1065_I Think I Need a Houseboat_201311160023
I Think I Need a Houseboat
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7452 Accepted Submission(s): 2160

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.)

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.
“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.
#include <stdio.h>
#define pi 3.1415926
int main()
{
int i,T;
scanf("%d",&T);
for(i=;i<=T;i++)
{
double x,y,t;
scanf("%lf %lf",&x,&y);
t = x*x + y*y;
printf("Property %d: This property will begin eroding in year %d.\n",i,(int)(t*pi/)+);
}
printf("END OF OUTPUT.\n");
//while(1);
return ;
}
简单题
hdu_1065_I Think I Need a Houseboat_201311160023的更多相关文章
随机推荐
- astgo-官方提供的使用技巧大全
Astgo服务器相关: 1.Astgo支持双IP绑定,比如联通.电信IP,Astgo 默认SIP端口 5080和5061 菜单: 选项->系统设置 可以设置以上参数 2.支持RC4加密,自动判断 ...
- Elasticsearch索引的操作,利用kibana(如何创建/删除一个es的索引?)
我们已经通过索引一篇文档创建了一个新的索引 .这个索引采用的是默认的配置,新的字段通过动态映射的方式被添加到类型映射.现在我们需要对这个建立索引的过程做更多的控制:我们想要确保这个索引有数量适中的主分 ...
- notepad + +使用步骤
原文地址:https://blog.csdn.net/so_geili/article/details/79317001#一-安装notepad 一. 安装notepad + + notepad+ ...
- 八皇后问题---详解---参考<<紫书>>
在一个8*8的棋盘上 放置八个皇后 , 使得他们互相不攻击(皇后攻击范围为 同行同列同对角线) , 方法一 : 从64个格子中 选一个子集 , 使得 " 子集 中恰好有八个元素 , 且任意 ...
- [转]发布基于T4模板引擎的代码生成器[Kalman Studio]
本文转自:http://www.cnblogs.com/lingyun_k/archive/2010/05/08/1730771.html 自己空闲时间写的一个代码生成器,基于T4模板引擎的,也不仅是 ...
- 转:java中static、final、static final的区别
http://blog.csdn.net/qq1623267754/article/details/36190715 final可以修饰:属性,方法,类,局部变量(方法中的变量) final修饰的属性 ...
- Microsoft SQL Server学习(二)--数据库的语法
关于数据库的语法 创建数据库 样例 名词概念 编写数据库代码的注意事项 关于文件语法 实例代码 关于数据库的语法: 1.创建数据库 create database 数据库名 on primary (主 ...
- linux下vim命令汇总
一. 进入vi的命令 vi filename : 打开或新建文件,并将光标置于第一行首 vi +n filename : 打开文件,并将光标置于第n行首 vi + filename : 打开文件,并将 ...
- CSS中的disable,hidden,readonly
项目中有时候需要对某个input进行隐藏或者禁止修改等. 需要隐藏某个input的时候就用hidden <input hidden="true" > 如果要禁止修改in ...
- JAVA趣味逻辑算法
/**已知4位同学中的一位数学考了100分,当小李询问这4位是谁考了100分时,4个人的回答如下: A说:不是我. B说:是C C说:是D. D说:他胡说. 已知三个人说的是真话,一个人说的是假话.现 ...