I - I Think I Need a Houseboat解题报告(熊禾强)

百炼1005:I Think I Need a Houseboat 描述 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 squ... 阅读详情

I - I Think I Need a Houseboat
Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u

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.

题目大意:给定x和y的值作为一个圆的圆心坐标,若海岸线以每年50的速度被侵蚀,其为半圆,求出当侵蚀到这个点时是第几年。

解题思路;:数学题,不解释

代码:


#include<stdio.h>
#include<math.h>
const double pi=acos(-1.0);
int main()
{
	double x,y;
	int i,n,k;
	   scanf("%d",&n);
		for(i=1;i<=n;i++)
		{
		scanf("%lf%lf",&x,&y);
            k=ceil(((x*x+y*y)*pi)/100)//向上取整
printf("Property %d: This property will begin eroding in year %d.\n",i,k);
		}
		printf("END OF OUTPUT.");
		return 0;




北大百炼1005 I Think I Need a Houseboat题解 1005:I Think I Need a Houseboat 总时间限制: 1000ms 内存限制: 65536kB 描述Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the la 阅读详情

相关推荐

【poj1005】I Think I Need a Houseboat 题解&代码(c++)

poj,二分

曾经追梦的happy时光 1210

【POJ】1005 I Think I Need a Houseboat

I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 65490   Accepted: 27502 Description Fred Mapper is considering purchasing some l

Manjushri的知识库 654

POJ1005-I Think I Need a Houseboat

北大POJ1005-I Think I Need a Houseboat 解题报告+AC代码

c语言练习:POJ 1005 我想我需要一艘船屋(I Think I Need a Houseboat)

题目相关信息 描述 弗雷德·马珀(Fred Mapper)正在考虑在路易斯安那州购买一些土地来建造他的房子。在调查这片土地的过程中,他了解到,由于密西西比河造成的侵蚀,路易斯安那州实际上每年都在缩小50平方英里。由于弗雷德希望一辈子都住在这所房子里,他需要知道他的土地是否会因侵蚀而消失。 在做了更多的研究之后,弗雷德了解到正在失去的土地形成了一个半圆形。这个半圆是以 (0,0) 为中心的圆的一部分,将圆平分的线是 X 轴。X 轴下方的位置在水中。半圆在第 1 年开始时的面积为 0。

m0_63002183的博客 1006

实测有效!易灵思FPGA工程如何正确配置Efinity+Modelsim仿真环境

本文详细介绍了易灵思FPGA工程中如何高效配置Efinity与Modelsim联合仿真环境,包括软件版本匹配、系统环境变量设置、工程文件结构优化及仿真脚本深度优化等实战经验。通过实测数据验证,该方案可显著提升仿真效率,适用于不同规模的设计验证,帮助工程师快速搭建稳定高效的联仿环境。

m2n3b4v5c6的博客 404

GD32H7系列SRAM优化配置实战指南

本文详细解析了GD32H7系列MCU的SRAM架构,包括ITCM、DTCM、AXI SRAM等关键内存区域的特点与性能差异。通过实战指南,指导开发者如何通过配置寄存器和链接脚本,优化内存布局以提升系统性能,并重点探讨了DMA操作与CPU缓存一致性的解决方案,帮助充分发挥GD32H7的高性能潜力。

weixin_29169899的博客 518

poj1005 I Think I Need a Houseboat 水题

poj1005 I Think I Need a Houseboat 题意:FM正在考虑在路易斯安那州购买一些土地来建他自己的房子,但他发现密西西比河岸某处陆地因为河水侵蚀,每年陆地面积都在减少,每年减少50平方英里,减少的陆地面积呈半圆形,即该半圆形面积以每年50平方英里的速度增长。

Lxp的博客 610

C++结合大漠插件实现DNF自动化脚本:从原理到实战

自动化技术通过模拟用户操作,实现重复性任务的自动执行,其核心原理在于对系统输入输出接口的精确控制。在Windows平台,这通常涉及窗口管理、图像识别与键鼠模拟等技术。这些技术为软件自动化测试、办公流程自动化及特定场景的辅助工具开发提供了工程实践基础。大漠插件作为国内广泛使用的Windows自动化开发组件,封装了上述底层操作,显著降低了开发门槛。通过其提供的COM接口,开发者可以高效实现窗口绑定、后台找图找色及内存读写等关键功能。本文以《地下城与勇士》为例,详细解析如何利用C++集成大漠插件,构建一个稳定、高

weixin_34185512的博客 571

北大ACM 1005题—I Think I Need a Houseboat

I Think I Need a Houseboat Time Limit:1000MS Memory Limit:10000K Total Submissions:77638 Accepted:33359 Description Fred Mapper is considering purchasing some l...

weixin_30906185的博客 337

vue3的面试题

vue3的面试题

jiang7701037的博客 6263

【基于CKF的IMM】CV和CT两个模型下的IMM,二维,滤波使用CKF(容积卡尔曼滤波),附完整的matlab代码

该文章摘要: 本文提出了一种基于交互多模型(IMM)和容积卡尔曼滤波(CKF)的融合定位算法,用于解决目标在直线运动和转弯机动之间的模型切换问题。通过MATLAB仿真实现了IMM-CKF算法,并与单一的CV-CKF(匀速模型)和CT-CKF(匀角速转弯模型)方法进行对比。实验结果表明,在包含直线段和转弯段的复合轨迹跟踪中,IMM-CKF方法能够自适应调整模型权重,显著提高了定位精度。轨迹跟踪图、位置/速度误差对比图以及模型概率曲线直观展示了IMM算法的优势。文章提供了完整的MATLAB实现代码,可用于目标跟

985工科博士毕业,专攻定位、导航和滤波等算法研究。从业10年,主要使用MATLAB 614

英语题翻译20

I Think I Need a Houseboat | JXNUOJ 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, du

zanhhhhhh的博客 272

【STM32 Blue Pill编程】-STM32CubeIDE开发环境搭建与点亮LED

本文为使用 STM32Cube IDE 的 STM32 Blue Pill 入门教程。 在本文中,我们将介绍如何控制 STM32 Blue Pill 的 GPIO 引脚。以及开发环境搭建。 本系列文章将重点介绍采用 ARM Cortex-M 的 BluepellSTM32F103C8 微控制器以及如何使用 STM32CubeIDE 对其进行编程。 STM32CubeIDE是STM32官网提供的IDE

视觉与物联智能 1067

POJ 1005 题的分析

题目:密西西比河岸某处陆地因为河水侵蚀,每年陆地面积都在减少,每年减少50平方英里,减少的陆地面积呈半圆形,即该半圆形面积以每年50平方英里的速度增长。在第一年初时,该半圆形面积为0,半圆形的圆心坐标为(0,0),现在的任务是给定一个坐标,求出该坐标在哪一年年底会被河水侵蚀。假设给定的坐标到圆心的距离不会等于半圆的半径。 输入:第一行输入坐标个数,第二行开始输入坐标,每个坐标占一行,每个坐标由横

小冰球 543

100天精通Python(可视化篇)——第89天:Bokeh库绘图可视化基础入门(参数说明+案例实战)

专栏导读 一、Bokeh是什么? 二、安装与导入 三、Bokeh接口介绍 四、创建图表 五、添加自定义渲染器 切换主题 添加图例 图例位置 图例方向 图例背景和边界 图例文本的外观 行列布局 网格布局

努力让自己发光,对的人才能迎着光而来 1万+

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

poj 1005

poj 1005 1.题目链接:poj 1005 2.题目解析: 题目告诉我们有一块半圆土地,以每年50个单位消失,问几年后开始完全消失 题目给出坐标,以次我们可以计算出半径,进而计算出这块土地的面积 根据题意,可得到公式:年数 = ½ πr² / 50 + 1(年数要取整,故加1) 3.代码示例 #include &amp;lt;stdio.h&amp;gt; #define PI 3.141592654 ...

Ich/liebe/dich的编程せかい 450

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

poj 1005(水题)

#include<iostream> #include<cmath> using namespace std; int main() { int n; cin >> n; int i,k = 1; while (n--) { float x, y; cin >> x >>...

Algcc的博客 304

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

I Think I Need a Houseboat(poj 1005)

1 问题描述 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 actuall

笨蛋9的博客 314

第三部分:POJ 1005 解题报告

POJ 1005 I Think I Need a Houseboat 【问题描述】 已知有一个圆心为(0,0),半径随时间增长的位于X轴上方的半圆,初始面积为0,每年的面积增加50,给出一个坐标,求该坐标在第几年被该半圆覆盖。

qq_40956679的博客 366

POJ——1005(I Think I Need a Houseboat)问题

程序代码如下: import java.math.BigDecimal; import java.math.RoundingMode; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scan...

WU2629409421perfect的博客 565

C - I Think I Need a Houseboat

C - I Think I Need a Houseboat 题目描述: 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 Louisian...

xiaosuC的博客 465

1005—I Think I Need a Houseboat

I Think I Need a Houseboat Time Limit:1000MS Memory Limit:10000K Total Submissions:105572 Accepted:45982 Description Fred Mapper is considering purchasing some land in Louisiana t...

weixin_30721899的博客 469

北大OJ_1005题:I Think I Need a Houseboat

#include #include using namespace std; #define PI_VAL 3.1415926535 int main() { int nCaseCount = 0; double xVal = 0.0f; double yVal = 0.0f; cin >> nCaseCount; for ( int i = 0; i < nCaseCount

憧憬,思考,奋斗,飞翔 1279

poj 1005 I Think I Need a Houseboat(简单计算题)

题目链接:http://poj.org/problem?id=1005 题意:密西西比河岸某处陆地因为河水侵蚀,每年陆地面积都在减少,每年减少50平方英里,减少的陆地面积呈半圆形,即该半圆形面积以每年50平方英里的速度增长。在第一年初时,该半圆形面积为0,半圆形的圆心坐标为(0,0),现在的任务是给定一个坐标,求出该坐标在哪一年年底会被河水侵蚀。假设给定的坐标到圆心的距离不会等于半圆的半径。

G++ 400
上一篇: H - Area in Triangle解题报告(熊禾强)
下一篇: J - Transmitters解题报告(熊禾强)
CSUST_ACM
博客等级 码龄15年 42粉丝 127原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值