Tanky WooRSS

HDOJ 1065 I Think I Need a Houseboat

27 Jul 2010
这篇博客是从旧博客 WordPress 迁移过来,内容可能存在转换异常。

水题。 题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1065 但要注意不能用第1年一直递增,然后判断第j-1年是否小于当前点的面积,且第j年是否大于当前点的面积。 这样会超时的。 直接相除即可! 代码:

// Author: Tanky Woo
// HDOJ 1065
#include 

#define PI 3.1415926
using namespace std;
int nCases;
double m, n;

int main()
{
    scanf("%d", &nCases;);
    for(int i=1; i<=nCases; ++i)
    {
        scanf("%lf %lf", &m;, &n;);
        printf("Property %d: This property will begin eroding in year %d.\n", i, 1+(int)(PI*(m*m+n*n)/2.0/50.0));
    }
    printf("END OF OUTPUT.\n");
    return 0;
}