I Think I Need a Houseboat

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12114    Accepted Submission(s): 3407

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.

pi*R[n]^2-pi*R[n-1]^2 =100 得到 R[n]^2 = 100*n/pi

直接得结果,破题有毒,pi只能取3.1415926

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<math.h>
using namespace std;
typedef long long LL;
const double pi = 3.1415926; int main()
{
int t;
scanf("%d",&t);
for(int i=; i<=t; i++)
{
double x,y;
scanf("%lf%lf",&x,&y);
double r = x*x+y*y; ///半径的平方
printf("Property %d: This property will begin eroding in year %d.\n",i,(int)((r)*pi/+));
}
printf("END OF OUTPUT.\n");
return ;
}

hdu 1065(推公式)的更多相关文章

  1. HDU 5047 推公式+别样输出

    题意:给n个‘M'形,问最多能把平面分成多少区域 解法:推公式 : f(n) = 4n(4n+1)/2 - 9n + 1 = (8n+1)(n-1)+2 前面部分有可能超long long,所以要转化 ...

  2. hdu 2197 推公式

    题意:由0和1组成的串中,不能表示为由几个相同的较小的串连接成的串,称为本原串,有多少个长为n(n<=100000000)的本原串?答案mod2008.例如,100100不是本原串,因为他是由两 ...

  3. hdu 5073 推公式相邻质心转换

    #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 51000 int cmp(co ...

  4. HDU 4870 Rating(概率、期望、推公式) && ZOJ 3415 Zhou Yu

    其实zoj 3415不是应该叫Yu Zhou吗...碰到ZOJ 3415之后用了第二个参考网址的方法去求通项,然后这次碰到4870不会搞.参考了chanme的,然后重新把周瑜跟排名都反复推导(不是推倒 ...

  5. 2017多校第7场 HDU 6128 Inverse of sum 推公式或者二次剩余

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6128 题意:给你n个数,问你有多少对i,j,满足i<j,并且1/(ai+aj)=1/ai+1/a ...

  6. HDU 4873 ZCC Loves Intersection(JAVA、大数、推公式)

    在一个D维空间,只有整点,点的每个维度的值是0~n-1 .现每秒生成D条线段,第i条线段与第i维度的轴平行.问D条线段的相交期望. 生成线段[a1,a2]的方法(假设该线段为第i条,即与第i维度的轴平 ...

  7. Balls and Boxes---hdu5810(推公式)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5810 有n个球m个盒子,随机把球放到盒子中,求每个盒子球个数的方差的期望值 E[V]; 推公式吧,或者 ...

  8. CCF 201312-4 有趣的数 (数位DP, 状压DP, 组合数学+暴力枚举, 推公式, 矩阵快速幂)

    问题描述 我们把一个数称为有趣的,当且仅当: 1. 它的数字只包含0, 1, 2, 3,且这四个数字都出现过至少一次. 2. 所有的0都出现在所有的1之前,而所有的2都出现在所有的3之前. 3. 最高 ...

  9. bjfu1211 推公式,筛素数

    题目是求fun(n)的值 fun(n)= Gcd(3)+Gcd(4)+…+Gcd(i)+…+Gcd(n).Gcd(n)=gcd(C[n][1],C[n][2],……,C[n][n-1])C[n][k] ...

随机推荐

  1. HDU-4848-Such Conquering

    这题就是深搜加剪枝,有一个很明显的剪枝,因为题目中给出了一个deadline,所以我们一定要用这个deadline来进行剪枝. 题目的意思是求到达每个点的时间总和,当时把题看错了,卡了好久. 剪枝一: ...

  2. 共享服务-FTP基础(一)

    介绍:文件传输协议FTP 两种模式:服务器角度 主动(PORT style):服务器主动连接 命令(控制):客户端:随机port --- 服务器:tcp21 数据:客户端:随机port ---服务 ...

  3. 在WIN2008R2的IIS7环境下安装PHP5.6.15

    1.下载PHP5.6.15 在http://windows.php.net/download页面中找到VC11 x64 Non Thread Safe下载ZIP版. 2.将下载的压缩包解压到D盘PHP ...

  4. Java并发编程的艺术 记录(三)

    Java内存模型 并发编程的两个关键问题: 1.线程之间如何通讯. 2.线程间如何同步. 两种方式:共享内存和消息传递. Java的并发采用的是共享内存模型,Java线程之间的通信总是隐式进行,整个通 ...

  5. svn 命令管理

    有时候测试环境会让更新到指定版本,用以验证问题或者其他原因 具体方法有两种: 方法1: svn merge回滚 1) 先 svn up,保证更新到最新的版本,如2106: 2) 然后用 svn log ...

  6. python网络编程相关

    什么是网络套接字socket?简述基于tcp协议的套接字的通信流程. 为了区别不同的应用程序进程和连接,许多计算机操作系统为应用程序与TCP/IP协议交互提供了称为套接字 (Socket)的接口,区分 ...

  7. launchMode

    launchMode在多个Activity跳转的过程中扮演着重要的角色,它可以决定是否生成新的Activity实例,是否重用已存在的Activity实例,是否和其他Activity实例公用一个task ...

  8. Django one

    WEB-Django: Http协议: http协议:超文本传输协议,基于TCP/IP通信协议来传递数据 特点: 1.灵活:允许传输任意类型的数据对象.正在传输的类型有Content-Type标记 2 ...

  9. luogu2590 [ZJOI2008]树的统计

    树剖裸题 #include <iostream> #include <cstdio> using namespace std; int n, uu, vv, hea[30005 ...

  10. Oracle 了解 DDL 操作与 REDO 的关系

    目录 了解 DDL 操作与 REDO 的关系 DDL是否会产生REDO 通过 10046 trace 来分析create 和drop 如果drop失败,redo的变化 了解 DDL 操作与 REDO ...