时间限制: 
1000ms
内存限制:
65536kB
描述
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.)

输入
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.
输出
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.”
样例输入
2
1.0 1.0
25.0 0.0
样例输出
Property 1: This property will begin eroding in year 1.
Property 2: This property will begin eroding in year 20.
END OF OUTPUT.
(1)、源代码:
#include<iostream>
usingnamespacestd;
constdoublePI = 3.1415926;
 
intmain ()
{
                intn, temp, count = 1;
                doublex, y, time;
 
                cin >> n;
                while(n-- > 0){
                                cin >> x >> y;
                                time = (x*x + y*y)*PI / 100;
                                temp = time;
                                if(temp < time)
                                                ++temp;
                                cout <<"Property "<< count++ <<": This property will begin eroding in year "<< temp <<"."<< endl;
                }
                cout <<"END OF OUTPUT."<< endl;
                return0 ;
}
 
(2)、解题思路:略
(3)、可能出错:略 

转载于:https://www.cnblogs.com/lydf-2012/archive/2012/05/11/2496639.html

POJ 1005 I Think I Need a Houseboat相关推荐

  1. poj 1005 I Think I Need a Houseboat

    点击打开链接 大体意思:半圆表示一块面积可扩展的区域,开始时,面积是0,在(0,0)处开始以每年50平方米的速度同样呈半圆扩展,输入一个正整数N,然后输入N对坐标,对于每一对坐标值:求出面积扩展到该点 ...

  2. POJ前面的题目算法思路【转】

    1000 A+B Problem 送分题 49% 2005-5-7 1001 Exponentiation 高精度 85% 2005-5-7 1002 487-3279 n/a 90% 2005-5- ...

  3. POJ 超详细分类

    POJ 各题算法 1000    A+B Problem            送分题     49%    2005-5-7 1001    Exponentiation         高精度   ...

  4. 1005:I Think I Need a Houseboat-poj

    1005:I Think I Need a Houseboat 总时间限制:  1000ms 内存限制:  65536kB 描述 Fred Mapper is considering purchasi ...

  5. POJ1003/1004/1005/1207/3299/2159/1083/3094/2388解题(刷一波水题)

    POJ 1003 题目链接 http://poj.org/problem?id=1003 大意:长度=1/2+1/3+-+1/n,给定长度值,求n #include<iostream> u ...

  6. POJ的题目分类(两个版本)

    版本一: 简单题 1000A+B Problem 1001Exponentiation 1003 Hangover 1004 Financial Management 1005 I Think I N ...

  7. poj题目详细分类及算法推荐题目

    DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题  ...

  8. ACM POJ 题目分类(完整整理版本)

    DP: 1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题   ...

  9. POJ ZOJ题目分类

    POJ,ZOJ题目分类(多篇整合版,分类很细致,全面) 标签: 题目分类POJ整理 2015-04-18 14:44 1672人阅读 评论(0) 收藏 举报 本文章已收录于: 分类: ACM资料(5) ...

  10. POJ,ZOJ题目分类(多篇整合版,分类很细致,全面)

    水题: 3299,2159,2739,1083,2262,1503,3006,2255,3094 初级: 一.基本算法:        (1)枚举 (1753,2965)       (2)贪心(13 ...

最新文章

  1. 用MSMTP+MUTT搭建日志邮件发送系统
  2. 孔兵 库卡机器人_库卡机器人中华区CEO孔兵:机器人是制造业升级的关键
  3. javascript 窗口加载事件相关问题
  4. 解析针对 HTTP/2 协议的不同步攻击
  5. Oracle闪回报错,oracle 闪回区满了,ORA-19815
  6. python中*args **kwargs
  7. 将数字n转换为字符串并保存到s中
  8. elastic 常用操作
  9. 将python程序打包成exe
  10. 机器学习基本算法思想和步骤
  11. Ubuntu18.04的截图问题
  12. PS CC2019新手必学基础(首选项)设置
  13. 天下武功唯快不破--速度要快
  14. 万年历源代码 c语言基础,C语言万年历的源程序
  15. Flask--Blueprint(蓝图)简单使用笔记
  16. 程序员视角的计算机系统 第一章 计算机系统 之旅
  17. grain是计算机英语术语,词汇精选:grain的用法和辨析
  18. Explaining away
  19. 创业圈里那些魔性的拒绝史:张朝阳拒绝马化腾、马化腾拒绝马云...
  20. [Pytorch框架] PyTorch 中文手册

热门文章

  1. 腾达无线路由器如何开启无线中继功能
  2. java list 泛型 转换_Java中List与数组互相转换
  3. Dxg——[版本管理工具Git SVN]开发笔记整理分类合集【所有的相关记录,都整理在此】
  4. C++ byte数组/char数组 转 int16 int32
  5. quot在c语言里用法,C语言中“#”和quot;##quot;的用法
  6. java桥梁模式_java设计模式之桥梁模式(Bridge)
  7. arcgis交通可达性分析步骤_可达性分析(二):基于Network Analys的服务区分析
  8. python使用opencv图像聚类_Python3 OpenCV3图像处理-K-means 聚类
  9. 综合布线系统入门及应用(一)
  10. 大规模均衡分割与层次聚类