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. BZOJ-1833(数位DP)

    #include <bits/stdc++.h> using namespace std; typedef long long ll; ll a,b; int k[20]; ll dp[2 ...

  2. 【贪心 计数 倍增】bzoj4458: GTY的OJ

    倍增写挂调了半个晚上 Description 身为IOI金牌的gtyzs有自己的一个OJ,名曰GOJ.GOJ上的题目可谓是高质量而又经典,他在他的OJ里面定义了一个树形的分类目录,且两个相同级别的目录 ...

  3. How To Add Swap Space on Ubuntu 16.04

    Introduction One of the easiest way of increasing the responsiveness of your server and guarding aga ...

  4. 分享几个能用的 editplus 注册码

    转载自: https://www.cnblogs.com/shihaiming/p/6422441.html 原文:http://host.zzidc.com/wljc/1286.html EditP ...

  5. python爬虫基础09-selenium大全3/8-Remote Webdriver

    Selenium笔记(3)Remote Webdriver 本文集链接:https://www.jianshu.com/nb/25338984 简介 selenium.webdriver.remote ...

  6. List<Object>删除某一个Object

    1.直接删除: List<LineShop> tlineprices  = new ArrayList<>(); tlineprices.remove(0); 2.使用遍历删除 ...

  7. 用Python对微信好友进行简单统计分析,获取好友的基本信息!

      早些日子有人问我我的微信里面有一共多少朋友,我就随后拉倒了通讯录最下面就找到了微信一共有多少位好友.然后他又问我,这里面你认识多少人?这一句话问的我很无语.一千多个好友我真的不知道认识的人有多少. ...

  8. poj 2676 数独问题 dfs

    题意:完成数独程序,数独要求每行每列且每个3*3矩阵都必须是1~9的数字组成. 思路:dfs 用row[i][n] 记录第i行n存在  用col[j][n] 记录第j列n存在 grid[k][n] 记 ...

  9. luogu2564 [SCOI2009]生日礼物

    排序枚举左端点,则右端点必定不降 #include <algorithm> #include <iostream> #include <cstring> #incl ...

  10. [每日App一]QQ主题要逆天!轻轻松松月入30万!

    听从吾师秦刚(微信或QQ:1111884)酋长的建议,谋哥(微信viyi88)我开始新的征程,每日更新一篇干货文章(要坚持啊!否则被酋长鄙视了). 好了,废话不多说,今天我给大家揭秘一个你从来想也木有 ...