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 |
是一个配方题n<=i(i+1)/2 ->> 2*n+1/4<=(i+1/2)^2 ->> sqrt(2*n+1/4)<=i+1/2 ->> a = sqrt(2*n+1/4)-1/2<=i; if a==floor(sqrt(2*n+1/4)-1/2) ->> ans = a; else ans = n - i*(i+1)/2 {i=floor(sqrt(2*n+1/4)-1/2)} Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator