zju 1439. Wrong Answer, Why? 请LeeMaRS等作过的过来看一下。
孩皮妞野 2003-02-19 01:29:14 上面写exact to three digits to the right of the decimal point精确到小数点后三位。实际上是4舍5入到小数点后3位。
样题我算到0.171, 还以为是计算过程中舍入误差太大,推导出r^2/R^2的计算公式。
s/S = r^2/R^2
1
= ---------------------------------------------------------
/ 1 1 \^2
b^2*c^2*| ---------------- + ------------------ |
\ 2ac-a^2-c^2+b^2 2ab-a^2-b^2+c^2 /
其中s、r是小园面积和半径;S、R是大园面积和半径。a,b,c是三角形3条边的长度。
使用doulbe,这个算式的精度应该足够了。可是还是Wrong Answer.
请问你们是怎样解的?