Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

几周前写的自己运行起来都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 on Problem 1925
换了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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator