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的更多相关文章
随机推荐
- Coursera Algorithms week4 基础标签表 练习测验:Check if a binary tree is a BST
题目原文: Given a binary tree where each
- [jzoj NOIP2018模拟10.23]
丢分主要是下面几个方面: 1.T2代码交错了,有个特判没写丢了10分 2.T1线段树加等差数列写错了(其实二维差分就可以,但我当时不会) 3.T3思考再三还是为了10分写上了主席树,还是写错了 总体评 ...
- SQLServer局部变量和全局变量介绍05-29学习笔记
变量 数据在内存中存储可以变化的量叫变量.为了在内存中存储信息,用户必须指定存储信息的单元,并为了该存储单元命名, 以方便获取信息,这就是变量的功能.Transact-SQL可以使用两种变量,一种是局 ...
- BZOJ 5277 IQ题orz
思路: 首先我们注意到,对一个序列按分割点分开以后分别冒泡其实就相当于对整个序列进行冒泡.每一个元素都会对复杂度贡献1,除非一个元素两边的分割点都出现了.因此我们可以完全忽略快排的递归过程.只需考虑每 ...
- oracle 行转列函数pivot和unpivot
今天接到业务部门的一个需求,需要对同一公司的不同财务指标进行排序,需要用到oracle的行转列函数unpivot. 财务报表的表结构为: 要实现业务部门的排序筛选功能,需要首先将行数据转为列数据: 使 ...
- JVM 内存分配和垃圾回收(GC)机制
一 判断对象是否存活 垃圾收集器在对堆进行回收前,第一件事情就是要确定这些对象之中哪些还“活着”,哪些已经"死去”,即不能再被任何途径使用的对象. 1.1 引用计数法 (Reference ...
- android黑科技系列——获取加固后应用App的所有方法信息
一.前言 在逆向应用的时候,我们有时候希望能够快速定位到应用的关键方法,在之前我已经详细介绍了一个自己研发的代码动态注入工具icodetools,来进行动态注入日志信息到应用中,不了解的同学可以查看这 ...
- Objective-C在ARC下结合GCD的单例模式和宏模版
单例模式在iOS开发过程中经常用到,苹果提供过objective c单例的比较官方的写法: static MyGizmoClass *sharedGizmoManager = nil; + (MyGi ...
- Boolean对象与Boolean原始值的区别
我们先来看下面这道题: var x = new Boolean(false); if (x) { alert('hi'); } var y = Boolean(0); if (y) { ale ...
- vim三种模式
一般模式 以vi打开一个文件就直接进入一般模式了.一般模式下可以移动光标查看内容,通过ESC回到一般模式. 一般模式下常用的操作: 撤销与重做 命令 说明 u 复原上一个操作 . 小数点 重复上一个操 ...