Poj 1005

刚开始的时候下意识想把坐标半径和每一年淹没的半径求出来做比较……

 1 #include<iostream>
 2 #define pi 3.14159265
 3 using namespace std;
 4 int main(){
 5     int N;
 6     double x,y;
 7     int year;
 8     cin>>N;
 9     for(int i=0;i<N;i++){
10         cin>>x>>y;
11         year=pi*(x*x+y*y)/100+1;
12         cout<<"Property "<<i+1<<": This property will begin eroding in year "<<year<<"."<<endl;
13     }
14     cout<<"END OF OUTPUT.";
15 } 
时间: 2024-08-25 03:49:03

Poj 1005的相关文章

poj 1005:I Think I Need a Houseboat(水题,模拟)

I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 85149   Accepted: 36857 Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land,

poj 1005 I Think I Need a Houseboat

1 #include <iostream> 2 using namespace std; 3 const double pi = 3.1415926535; 4 5 int main() 6 { 7 int t,time = 0;; 8 double x,y; 9 cin >> t; 10 while(t--) 11 { 12 ++time; 13 cin >> x >> y; 14 double area = pi*(x*x + y*y); 15 int

POJ 1005 解题报告

题意就是,有一块半圆形区域,从0,0点开始向四周扩展,每年扩展50.0面积(单位统一不用考虑). 计算给定点在第几年结束之前被圆形区域覆盖. 我的思路: 1.计算以给定点到原点长度的半径做半圆的面积. 2.除以50.0,所得结果加1,就是所求 PI取3.14159265 #include<iostream> #include<string> using namespace std; int main() { double x, y; int n; const double PI =

POJ 1005 I Think I Need a Houseboat 水

 I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 92807   Accepted: 40360 Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the lan

poj 1005(π的反三角)

我太菜了 只能水水题维持生活这样子 I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 113609   Accepted: 49040 Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of inves

POJ题目Java代码(一)

POJ 1001 Exponentiation import java.math.BigDecimal; import java.util.Scanner; public class Poj1001 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ BigDecimal bigDecimal = new BigDecimal(sc.next())

poj 5001 Walk &amp;&amp;2014 ACM/ICPC Asia Regional Anshan Online 1005(dp)

http://acm.hdu.edu.cn/showproblem.php?pid=5001 思路:dp计算出途径每个点的总概率,1-x即为所求解. dp题,先介绍下dp[i][j]为第j步走在第i个点的概率,那么dp[i][j]=dp[x1][j-1]+dp[x2][j-1]+...,x1,x2为i 的相邻节点.上一步在相邻节点这一步才能走到该点嘛. 每个点概率要一个一个的算,当算到第ii个点时(没打错,ii个点与代码对应),从起点推起,起点嘛,算是第0步吧,每个点被选中几率1.0/n,直接计

POJ 1064 1759 3484 3061 (二分搜索)

POJ 1064 题意 有N条绳子,它们长度分别为Li.如果从它们中切割出K条长度相同的绳子的话,这K条绳子每条最长能有多长?答案保留小数点后2位. 思路 二分搜索.这里要注意精度问题,代码中有详细说明:还有printf的%.2f会四舍五入的,需要*100再取整以截取小数点后两位. #include<stdio.h> #include<string.h> #include<string> #include<iostream> #include<math

POJ Ikki&#39;s Story IV - Panda&#39;s Trick [2-SAT]

题意: 圆上n个点,m对点之间连边,连在园内或园外,所有边不相交是否可行 发现两对点连线都在内相交则都在外也相交,那么只有一个在内一个在外啦,转化为$2-SAT$问题 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace std; const int N=1005,M=5e5; t