摘要: 这是很简单的二分搜索;需要注意的是精度。一开始我用的是right-left<1e-4,测试样例中100我输出的最后一位为1,不合要求。后来自己写了个四舍五入的一段,但交上去WA,于是改成1e-6,AC了。代码题目如下:Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky.InputThe first line of the input contai 阅读全文
posted @ 2012-04-25 23:59 SmallMushroom 阅读(240) 评论(0) 推荐(0) 编辑