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 |
精度问题=,=变量定义成double会有精度问题,换成long long。 dis函数求距离的平方,避免精度。 long long ans; cout<<ans/2.0<<endl; 这么写也会WA; 最后换成 long long ans; if(ans%2==0) cout<<ans/2<<endl; else cout<<ans/2<<".5"<<endl; 才过了=,= 蛋疼的精度问题 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator