I Think I Need a Houseboat

Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 99271   Accepted: 43245

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.”

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

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.

Source

 
分析:水水更开心
 
 #include <stdio.h>

 #define MAX_NUM 100

 int gwNum;
float gwX[MAX_NUM];
float gwY[MAX_NUM];
int gwYear[MAX_NUM]; void GetData()
{
int i = ;
scanf("%d",&gwNum);
for(i=; i<gwNum; i++)
{
scanf("%f %f", &gwX[i], &gwY[i]);
}
} void Calc()
{
int i = ;
for(i=; i<gwNum; i++)
{
gwYear[i] = (int)(3.14*(gwX[i]*gwX[i]+gwY[i]*gwY[i])/) + ;
}
} void PrintResult()
{
int i = ;
for(i=; i<gwNum; i++)
{
printf("Property %d: This property will begin eroding in year %d.\n", i+, gwYear[i]);
}
printf("END OF OUTPUT.");
} int main(void)
{
GetData();
Calc();
PrintResult();
return ;
}

北大poj-1005的更多相关文章

  1. I Think I Need a Houseboat POJ - 1005

    I Think I Need a Houseboat POJ - 1005 解题思路:水题 #include <iostream> #include <cstdio> #inc ...

  2. 北大POJ题库使用指南

    原文地址:北大POJ题库使用指南 北大ACM题分类主流算法: 1.搜索 //回溯 2.DP(动态规划)//记忆化搜索 3.贪心 4.图论 //最短路径.最小生成树.网络流 5.数论 //组合数学(排列 ...

  3. POJ. 1005 I Think I Need a Houseboat(水 )

    POJ. 1005 I Think I Need a Houseboat(水 ) 代码总览 #include <cstdio> #include <cstring> #incl ...

  4. 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 ...

  5. POJ 1005 解题报告

    1.题目描述   2.解题思路 好吧,这是个水题,我的目的暂时是把poj第一页刷之,所以水题也写写吧,这个题简单数学常识而已,给定坐标(x,y),易知当圆心为(0,0)时,半圆面积为0.5*PI*(x ...

  6. [POJ 1005] I Think I Need a Houseboat C++解题

        I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 81874   ...

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

    I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 85149   Acce ...

  8. poj: 1005

    简单题 #include <iostream> #include <stdio.h> #include <string.h> #include <stack& ...

  9. poj 1005 I Think I Need a Houseboat

    #include <iostream> using namespace std; const double pi = 3.1415926535; int main() { ;; doubl ...

  10. [POJ] #1005# I Think I Need a Houseboat : 浮点数运算

    一. 题目 I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 97512 ...

随机推荐

  1. 7 -- Spring的基本用法 -- 1...2

    7.1 Spring简介和Spring4.0的变化 7.1.1 Spring 简介 当使用Spring框架时,必须使用Spring Core Container(即Spring容器),它代表了Spri ...

  2. angularjs路由

    需要引入angular.js,angular-ui-router.min.js <ul> <li><a href="#home">首页</ ...

  3. jmeter Transaction Controller学习

    测试计划组成:一个计时器(2秒),一个事物控制器,两个http request 在Transaction Controller中不勾选第2个选项就相当于lr中的忽略思考时间 没有勾选第2项的执行结果: ...

  4. 网站指纹识别工具——WhatWeb v0.4.7发布

      WhatWeb是一款网站指纹识别工具,主要针对的问题是:“这个网站使用的什么技术?”WhatWeb可以告诉你网站搭建使用的程序,包括何种CMS系统.什么博客系统.Javascript库.web服务 ...

  5. IdentityServer4 简单使用,包括api访问控制,openid的授权登录,js访问

    写在前面 先分享一首数摇:http://music.163.com/m/song?id=36089751&userid=52749763 其次是:对于identityServer理解并不是特别 ...

  6. FPGA图像处理 两路sensor的色调不一致

    怎么调?可以让两路sensor的色调一致.

  7. TabActivity 切换Activity界面

    TAB切换先上图,tab标题没有添加样式,因为setIndicator可以直接接收View,所以可以自己编辑样式: 也可以实现OnTabChangeListener监听tab的点击,改变tab点击后的 ...

  8. [转载]什么是FCKeditor?功能强大的HTML编辑器!

    天天在用FCKeditor写博客,但一直不清楚FCKeditor到底是什么,今天终于找到了一些相关的资料,大家一起来分享下. FCKeditor文本编辑程序(共享软件)为用户提供在线的文档编辑服务,其 ...

  9. spider_jpg

    __author__ = 'sus' #urllib模块提供了读取Web页面数据的接口import urllib#re模块主要包含了正则表达式import re#定义一个getHtml()函数def ...

  10. css3选择器详解

    css中除了早先最早的,ID选择器,class选择器一些以外在css3中新加入了新的选择器,新选择器的使用大大的方便了我们的编程,下面我就说一些css3的选择器的使用方法, p       选择了所有 ...