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. python——创建django项目全攻略(野生程序员到家养程序员的完美进化)

    新建工程 我用pycharm写代码,所以一般就用pycharm创建django工程.右上角File-New Project.选择路径,修改项目名称,确定.就可以创建一个新的django工程.     ...

  2. [转]IE8兼容Jquery.validate.js兼容问题

    只需在jquery.validate.js 文件中在446行附近找到return $([]).add(this.currentForm.elements).filter(":input&qu ...

  3. (C# & Unity) 脚本语言 ES

    C# 编写,解释执行,语法类似 JS,动态类型,支持闭包,支持热更新,效率比较低,目前暂时没有发现 BUG,实际游戏运行稳定,没有发现内存泄漏 Github:https://github.com/ea ...

  4. IIS 7.5最新解析漏洞

    IIS7.5解析漏洞 http://www.cnk0n9.com/fckeditor/editor/fckeditor.html, 上传图片,浏览,上传一个aspx的一句话木马,名字为:a.aspx. ...

  5. Windows添加和取消右键管理员权限

    亲测可用 新建文本文档,粘贴下列代码 Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\*\shell\runas]@="管理员取 ...

  6. windows php swoole 安装

    Cygwin 官方地址:http://www.cygwin.com/ swoole 官方下载地址:https://github.com/swoole/swoole-src/releases 1.下载 ...

  7. 时间的处理 --java

    得到当天时间 SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd" ); String todayData = ...

  8. 楼盘信息sq

    ID:1 楼盘名称:帝豪国际 网址:http://shangqiu.jiwu.com/loupan/239023.html 价格:2500元/平米 关注人数:497 地址:长寿大道南段 情况:在售 大 ...

  9. 测试一下Word发布刚刚发现通过Word 可以直接发Blog 感觉很新奇,先看看,如果可以呢,将发通知的改了。

      刚刚发现通过Word 可以直接发Blog 感觉很新奇,先看看,如果可以呢,将发通知的改了.   刚刚发现通过Word 可以直接发Blog 感觉很新奇,先看看,如果可以呢,将发通知的改了.     ...

  10. sql server 脚本创建数据库和表

    USE [master] GO IF EXISTS(SELECT 1 FROM sysdatabases WHERE NAME=N'HkTemp') BEGIN DROP DATABASE HkTem ...