D - I Think I Need a Houseboat(1.3.1)
Description
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
miles. The Y coordinate will be non-negative. (0,0) will not be given.
Output
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.”
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.
#include <iostream>
#include<cmath>
using namespace std;
double PI=3.14 ;
int main()
{
int n,s;
double x,y;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x>>y;
x = (x*x + y*y)* PI / 2 / 50;
s=x;
if(x-s>0)
s++; printf("Property %d: This property will begin eroding in year %d.\n", i, s); }
printf("END OF OUTPUT.\n");
return 0;}
D - I Think I Need a Houseboat(1.3.1)的更多相关文章
- poj 1005:I Think I Need a Houseboat(水题,模拟)
I Think I Need a Houseboat Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 85149 Acce ...
- I Think I Need a Houseboat 分类: POJ 2015-06-11 17:52 12人阅读 评论(0) 收藏
I Think I Need a Houseboat Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 92090 Acce ...
- [POJ] #1005# I Think I Need a Houseboat : 浮点数运算
一. 题目 I Think I Need a Houseboat Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 97512 ...
- 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 ...
- 每天一道算法_6_I Think I Need a Houseboat
今天的题目是I Think I Need a Houseboat 如下: Description Fred Mapper is considering purchasing some land in ...
- I Think I Need a Houseboat
I Think I Need a Houseboat Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java ...
- HDU1065 I Think I Need a Houseboat 【数学递推】
I Think I Need a Houseboat Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
- I Think I Need a Houseboat POJ - 1005
I Think I Need a Houseboat POJ - 1005 解题思路:水题 #include <iostream> #include <cstdio> #inc ...
- HDU1065 I Think I Need a Houseboat 2016-07-24 13:59 101人阅读 评论(0) 收藏
I Think I Need a Houseboat Problem Description Fred Mapper is considering purchasing some land in Lo ...
- POJ. 1005 I Think I Need a Houseboat(水 )
POJ. 1005 I Think I Need a Houseboat(水 ) 代码总览 #include <cstdio> #include <cstring> #incl ...
随机推荐
- 【LOJ】#2722. 「NOI2018」情报中心
https://loj.ac/problem/2722 题解 考场上想了60分,但是由于自己不知道在怎么zz,我连那个ai<bi都没看到,误以为出题人没给lca不相同的部分分,然后觉得lca不同 ...
- 第一个web程序(web.xml , ServletConfig , ServletContext)
一:第一个jsp程序 1.项目设计结构 2.新建Person.java package com.java.demo; public class Person { public void printSt ...
- thinphp中auth认证方法使用
一.获取Auth类1.ThinkPHP3.1.3完整版:http://www.thinkphp.cn/down/338.html2.OneThink1.0正式版:https://github.com/ ...
- java中int和Integer比较
java中int和Integer比较 一,类型区别 我们知道java中由两种数据类型,即基本类型和对象类型,int就是基本数据类型,而Integer是一个class,也习惯把Integer叫做int的 ...
- CSUOJ 1271 Brackets Sequence 括号匹配
Description ]. Output For each test case, print how many places there are, into which you insert a ' ...
- python抓包模块
pcapy模块 安装 yum install -y epel-release yum install -y pip gcc gcc-c++ libpcap-devel python-deve ...
- 机器学习之路:python 集成分类器 随机森林分类RandomForestClassifier 梯度提升决策树分类GradientBoostingClassifier 预测泰坦尼克号幸存者
python3 学习使用随机森林分类器 梯度提升决策树分类 的api,并将他们和单一决策树预测结果做出对比 附上我的git,欢迎大家来参考我其他分类器的代码: https://github.com/l ...
- SKLearn数据集API(二)
注:本文是人工智能研究网的学习笔记 计算机生成的数据集 用于分类任务和聚类任务,这些函数产生样本特征向量矩阵以及对应的类别标签集合. 数据集 简介 make_blobs 多类单标签数据集,为每个类分配 ...
- BZOJ 2120: 数颜色 带修改的莫队算法 树状数组套主席树
https://www.lydsy.com/JudgeOnline/problem.php?id=2120 标题里是两种不同的解法. 带修改的莫队和普通莫队比多了个修改操作,影响不大,但是注意一下细节 ...
- 【Python3】【树形dp】uva10253 Series-Parallel Networks
设“共n个叶子,且每个非叶节点至少有两个子节点”的树的数量为f[n],再乘2就是本题答案. 设状态d(i,j)表示每棵子树最多包含i个叶子.一共有j个叶子的树的个数.于是f(n)=d(n-1,n).假 ...