poj 1005:I Think I Need a Houseboat(水题,模拟)
Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 85149 | Accepted: 36857 |
Description
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
Output
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.
Hint
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.
Source
- #include <iostream>
- #include <cmath>
- using namespace std;
- const double PI = acos(-);
- int main()
- {
- int N,Case;
- double x,y;
- cin>>N;
- for(Case=;Case<=N;Case++){
- cin>>x>>y;
- double R2 = x*x+y*y, r2 = 100.0/PI,sum = ;
- int year = ;
- while(r2<R2){
- sum+=;
- r2 = sum/PI;
- year++;
- }
- cout<<"Property "<<Case<<": This property will begin eroding in year "<<year<<'.'<<endl;
- }
- cout<<"END OF OUTPUT."<<endl;
- return ;
- }
Freecode : www.cnblogs.com/yym2013
poj 1005:I Think I Need a Houseboat(水题,模拟)的更多相关文章
- POJ. 1005 I Think I Need a Houseboat(水 )
POJ. 1005 I Think I Need a Houseboat(水 ) 代码总览 #include <cstdio> #include <cstring> #incl ...
- OpenJudge/Poj 1005 I Think I Need a Houseboat
1.链接地址: http://bailian.openjudge.cn/practice/1005/ http://poj.org/problem?id=1005 2.题目: I Think I Ne ...
- [POJ 1005] I Think I Need a Houseboat C++解题
I Think I Need a Houseboat Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 81874 ...
- [POJ] #1005# I Think I Need a Houseboat : 浮点数运算
一. 题目 I Think I Need a Houseboat Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 97512 ...
- poj 1005 I Think I Need a Houseboat
#include <iostream> using namespace std; const double pi = 3.1415926535; int main() { ;; doubl ...
- POJ 2342 &&HDU 1520 Anniversary party 树形DP 水题
一个公司的职员是分级制度的,所有员工刚好是一个树形结构,现在公司要举办一个聚会,邀请部分职员来参加. 要求: 1.为了聚会有趣,若邀请了一个职员,则该职员的直接上级(即父节点)和直接下级(即儿子节点) ...
- POJ 2195 一人一房 最小费用流 建图 水题
Going Home Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 21010 Accepted: 10614 Desc ...
- poj 2586 Y2K Accounting Bug(贪心算法,水题一枚)
#include <iostream> using namespace std; /*248K 32MS*/ int main() { int s,d; while(cin>> ...
- POJ 1269 Intersecting Lines(线段相交,水题)
id=1269" rel="nofollow">Intersecting Lines 大意:给你两条直线的坐标,推断两条直线是否共线.平行.相交.若相交.求出交点. ...
随机推荐
- mysql互换表中两列数据方法
1.创建表及记录用于测试 ) unsigned ) ,) unsigned ,) unsigned NOT NULL COMMENT '现价', PRIMARY KEY (`id`) ) ENGINE ...
- django 操作数据库--orm(object relation mapping)---models
思想 django为使用一种新的方式,即:关系对象映射(Object Relational Mapping,简称ORM). PHP:activerecord Java:Hibernate C#:Ent ...
- hadoop小试
standard mode(标准模式) 下载 wget http://mirror.bit.edu.cn/apache/hadoop/common/stable/hadoop-2.7.2.tar.gz ...
- SqlServer coalesce函数
SqlServer数据库中coalesce函数用法:在SqlServer2005中有了新的函数,它非常的实用,它就是coalesce函数,此函数可以返回参数中的第一个非空表达式,当你要在N个字段中选取 ...
- POJ 1426
http://poj.org/problem?id=1426 一道广搜的题目. 题意就是给你一个n,要你求出n的倍数中,只存在0和1的那个数字 所谓的只存在0和1,那么就是某个数的十倍或者十倍+1,而 ...
- Appium+Robotframework实现Android应用的自动化测试-4:AppiumLibrary介绍和安装
Appium是个好东东,Android,iOS都支持,并且居然RobotFramework也支持Appium了,这就是本文要介绍的AppiumLibrary. 通过前面的文章大家知道可以使用多种语言来 ...
- perl 引用(一)
1. 普通变量引用 variable reference 引用就好比C语言的指针,引用变量存储被引用变量的地址.赋值时注意要在变量前加上 \;使用时要多加一个 $ . 当然,引用也可以成为简单变量,可 ...
- ACM/ICPC 之 昂贵的聘礼-最短路解法(POJ1062)
//转移为最短路问题,枚举必经每一个不小于酋长等级的人的最短路 //Time:16Ms Memory:208K #include<iostream> #include<cstring ...
- nyoj366_D的小L_字典序_全排列
D的小L 时间限制:4000 ms | 内存限制:65535 KB 难度:2 描述 一天TC的匡匡找ACM的小L玩三国杀,但是这会小L忙着哩,不想和匡匡玩但又怕匡匡生气,这时小L给 ...
- ubuntu10.04+win7双系统,重装win7后,恢复grub引导菜单以及命令行引导linux
我在我的小Y上安装了ubuntu10.04和win7旗舰版的双系统,采用的是grub引导.今天win7不知道哪儿出了问题,windows update更新一直报错,(当然360也是打不上滴)网上查了很 ...