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

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
The first line of input will be a positive integer indicating how many data sets will be included (N).
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
For each data set, a single line of output should appear. This line should take the form of:
“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.
 
Source
 
 
 #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的更多相关文章

随机推荐

  1. 54. Extjs组件render说明

    转自:http://blog.chinaunix.net/uid-450400-id-2119168.html 1. 1.调用组件的render方法 panel.render('div'); 2.在配 ...

  2. 一个不错的jquery插件模版

    pageplugin.js (function ($) { $.PagePlugin = function (obj, opt) { var options = $.extend({}, $.Page ...

  3. Python细节(一)深浅拷贝

    深浅拷贝 只要涉及拷贝,就会涉及创建新对象 浅拷贝,会创建一个新的容器,列表中的元素和原列表的元素用的是同一个内存空间 第一种方法:从头切到尾,完整的复制一份 lst = [1,2,3,4] lst1 ...

  4. scrapy 简单操作

    1.创建一个简单的scrapy项目 scrapy startproject search(项目名称)按照提示cd searchscrapy genspider serachname search.co ...

  5. dynamic_cast 与 typeid

    C++中的类型转换分为两种: 隐式类型转换: 显式类型转换. 隐式类型转换一般都是不经意间就发生了,比如int + float 时,int就被隐式的转换为float类型了. 显示类型转换包括四种方式: ...

  6. 【转】DOS与linux的断行字符

    转自:http://www.2cto.com/os/201109/104833.html 今天配置linux的dns服务器,在配置的时候,在linux下修改配置文件感觉很麻烦,于是想到把配置文件拿到w ...

  7. C#学习-执行存储过程

    使用存储的优点 1.执行更快.直接写sql脚本会有个解析编译的过程. 2.修改方便.当业务改变时,只需要改存储过程,不需要修改C#代码 3.传递Sql脚本数据相对更小 缺点: 1.使用存储过程,数据库 ...

  8. [ BZOJ 4318 & 3450 / CodeForces 235 B ] OSU!

    \(\\\) \(Description\) 一共进行\(N\)次操作,生成一个长度为\(N\)的\(01\)序列,成功对应\(1\),失败对应\(0\),已知每一次操作的成功率\(p_i\). 在这 ...

  9. spring-framework-4.1.x源码阅读环境搭建(导入Eclipse)

    注意:搭建spring-framework-4.1.x源码 eclipse工作空间需要安装jdk8. spring-framework-4.1.x项目采用目前主流的项目管理工具gradle进行构建,至 ...

  10. [转]Wote用python语言写的imgHash.py

    #!/usr/bin/python import glob import os import sys from PIL import Image EXTS = 'jpg', 'jpeg', 'JPG' ...