标签:clu his cst ble 水题 color 3.1 math 面积
题意:给你一个半圆,半圆以面积每年增加50平方英里的速度扩张。问(x, y)在多少年后被覆盖、
思路:emmm,其实最开始,还是打表的,因为每一年的半圆的半径可以算出来。啊啊啊啊,其实这个方法是可以的。但是!!!wa了!
为什么?因为 ∏ 只可以取3.1415926 所以一直wa。
然后,看了网上的题解!秒懂!其实面积是等差数列!然后把 ∏ 改了过来,秒ac
#include<cstdio> #include<cmath> #define IP acos(-1) int main() { int t; scanf("%d", &t); for (int i = 1; i <= t; ++i) { double x, y; scanf("%lf%lf", &x, &y); printf("Property %d: This property will begin eroding in year %d.\n", i, int((x*x + y*y)*3.1415926 / 100.0 + 1)); } printf("END OF OUTPUT.\n"); }
A - I Think I Need a Houseboat HDU - 1065(水题)
标签:clu his cst ble 水题 color 3.1 math 面积
原文地址:https://www.cnblogs.com/ALINGMAOMAO/p/9768467.html