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 |
呵呵,你的是ceil,rhna的是floor,当然不同了In Reply To:几周前写的自己运行起来都TLE, 刚刚看了disscuss才知道每次对坐标的枚举不必从零开始,就差那么一句,我就一直TLE,自己写了个 p = (int)ceil(x[i] - sqrt(y[i]*y[i]-(y[i]-y[0])*(y[i]-y[0])));官方数据都过了(和pO Posted by:sunmoonstar_love at 2005-07-24 01:25:24 > 换了discuss里的 > > p = x[i] - (int)(sqrt((double)y[i] * y[i] - (double)(y[i] - y[0]) * (y[i] - y[0])) + 1e-12); > > 就AC了 > > p = (int)ceil(x[i] - sqrt(y[i]*y[i]-(y[i]-y[0])*(y[i]-y[0]))); > > > 实在分析不出二者为什么效果不同, 就是勾股定理,然后取个适当的整数,有什么不同? > > PS:网上down的2004beijing pre 的数据,和POJ的不同么? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator