ZOJ 1049 &&HDU 1065 I Think I Need a Houseboat
来源:互联网 发布:基恩士plc编程手册 编辑:程序博客网 时间:2024/05/20 10:13
链接:click here
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.)
题意:由坐标 (0,0) 开始,以半圆为形状每年侵蚀50 平方 miles ,问你从 (0,0) 开始到 (x,y) 结束需要多长时间 相当于给一个岛的腐蚀距离时间,给你点的坐标,问你多久被腐蚀。
思路:简单的数学题,不解释了。
代码:
#include <stdio.h>#include <string.h>#include <math.h>#include <iostream>#include <algorithm>using namespace std;const int Inf=0x3f3f3f3f;const int maxn=1000;const double eps=1e-6;const double pi=acos(-1.0);int n,m,i,j;int cost[maxn][maxn];double vis[maxn];double s(double x,double y){ return ((x*x+y*y)*pi)/2.0;}int main(){ int ncase,i,j=1; double x,y; cin>>ncase; while(ncase--) { int b; scanf("%lf%lf",&x,&y); printf("Property %d: This property will begin eroding in year %d.\n",j++,(int )ceil((s(x,y)/50))); } printf("END OF OUTPUT.\n");}
- HDU 1065 || ZOJ 1049 I Think I Need a Houseboat
- ZOJ 1049 &&HDU 1065 I Think I Need a Houseboat
- nyoj-159-I Think I Need a Houseboat//hdu-1065-I Think I Need a Houseboat
- ZOJ 1049 I Think I Need a Houseboat
- ZOJ 1049 I Think I Need a Houseboat
- ZOJ Problem Set - 1049 I Think I Need a Houseboat
- ZOJ 1049 I Think I Need a Houseboat
- ZOJ 1049 I Think I Need a Houseboat
- ZOJ Problem Set - 1049 I Think I Need a Houseboat
- ZOJ Problem Set - 1049||I Think I Need a Houseboat
- ZOJ 1049 I Think I Need a Houseboat
- ZOJ 1049 I Think I Need a Houseboat
- ZOJ--1049:I Think I Need a Houseboat
- ZOJ 1049 (I Think I Need a Houseboat)
- 【大水题】ZOJ 1049 I Think I need a Houseboat
- HDU----I Think I Need a Houseboat
- HDU I Think I Need a Houseboat
- hdu 1065 I Think I Need a Houseboat
- Linux显示目前登入系统的用户信息
- 站在两个世界的边缘——知无崖
- NYOJ——71
- 10个成为优秀程序员的有效方式
- 给大家推荐个超棒的SSH and telnet client工具:putty!
- ZOJ 1049 &&HDU 1065 I Think I Need a Houseboat
- Ubuntu12.04 64 编译 vrippack
- Linux显示各栏位的标题信息列
- [30天轻松掌握JavaWeb视频]-调整虚拟机大小
- Android中system.img的两种格式及其相互转换方法
- <<3D游戏编程大师技巧>> Raiders 项目配置
- Weka 3: Data Mining Software in Java
- NYOJ_6
- 跨域请求