关闭

hduoj1065 I Think I Need a Houseboat

85人阅读 评论(0) 收藏 举报
分类:

四个坑点:

1、pi 必须用 3.1415926.  

PS: pi 最精准的表示是 acos(-1). 头文件 math.h

2、每隔一年侵蚀的面积为50平方英里。如果整除50,当作下一年的。eg:如果面积扩充到40, 是第一年;面积扩充到50(边界线),是第二年;面积扩充到60, 是第二年。

PS:边界线要分清属于哪一块。

3、x, y要用double,不能用float。题目中给的说明是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. “floating point numbers”指的是浮点数,而不是用float, 默认用double。

PS:做题遇到能用double的,尽量不用float。特别是对精度可能有要求的题。

4、强制类型转换的使用。 return (int)area / 50 + 1; 会WA;return (int) (area / 50 + 1);就AC。

PS:强制类型转换要在计算完毕所有的之后,再转换。不要提前转换,导致精度受损。



0
0
查看评论

HDU1065 I Think I Need a Houseboat 【数学递推】

I Think I Need a Houseboat Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submiss...
  • u012846486
  • u012846486
  • 2014-07-23 10:43
  • 1048

hdu 1065 I Think I Need a Houseboat 水题,不过看discuss,应该有很多人在PI上栽跟头了

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 stat...
  • Lionel_D
  • Lionel_D
  • 2015-03-11 14:10
  • 875

北大百炼1005 I Think I Need a Houseboat题解

1005:I Think I Need a Houseboat 总时间限制: 1000ms 内存限制: 65536kB 描述Fred Mapper is considering purchasing some land in Louisi...
  • yuxuedashen
  • yuxuedashen
  • 2015-06-25 20:15
  • 178

POJ1005-I Think I Need a Houseboat

转载请注明出处:優YoU    http://user.qzone.qq.com/289065406/blog/1309404342 问题描述:Fred Mapper 正在考虑在路易斯安那州购买一些土地来建他自己的房子。在研究土地的过程中,他发现,路易斯安那州...
  • lyy289065406
  • lyy289065406
  • 2011-07-29 01:50
  • 5458

1005 I Think I Need a Houseboat(数学题)

I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 96615   Accepted: 42018 ...
  • liangzhaoyang1
  • liangzhaoyang1
  • 2016-04-05 13:28
  • 412

POJ1005 I Think I Need a Houseboat【π】

题目: Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he...
  • huanghanqian
  • huanghanqian
  • 2016-05-29 13:53
  • 206

I Think I Need a Houseboat(PKU1005)

/*题目四:I Think I Need a Houseboat(PKU1005) *作者:国风崽*/#includeusing namespace std;int main(){     float x,y;//坐标     &...
  • guofengzai
  • guofengzai
  • 2008-06-01 19:03
  • 831

poj1005(I Think I Need a Houseboat)

I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 63658   Accepted: 26676 D
  • ll365594480
  • ll365594480
  • 2011-09-11 21:41
  • 223

D - I Think I Need a Houseboat

D - I Think I Need a Houseboat Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %llu SubmitStatus Description Fred Mapper...
  • qq_32426313
  • qq_32426313
  • 2016-07-31 12:19
  • 158

1005:I Think I Need a Houseboat

水题,注意格式。 #include<iostream> #include<cmath> using namespace std; #define pi 3.1415926 int get_year(do...
  • zhang_han666
  • zhang_han666
  • 2018-02-09 13:45
  • 9
    个人资料
    • 访问:505次
    • 积分:51
    • 等级:
    • 排名:千里之外
    • 原创:5篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档