Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Faint 同样的问题,多谢啦!!!!In Reply To:提交了20多次再加上和同学AC的代码比较终于知道陷阱在哪儿了.估计WA的都是这样. Posted by:tq at 2005-08-02 18:39:51 > 题目说小数部分四舍五入其实是每算一次就要四舍五入一次. > 如果你用double型最后输出四舍五入的话,肯定就错了. > 一个好的方法是这样,用int 型,然后因为计算时数据都是整数,而除也只有除2的运算 > 所以只要:tot=tot+mile+(mile+1)/2; > 这样实现代替原来的:tot+=1.5*mile > 就可以AC了. > > 不过奇怪的是好象只有北大才会卡这种数据,因为在浙大不这样也能过. > 郁闷~~~~ Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator