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 |
Re:是一个配方题In Reply To:是一个配方题 Posted by:custqi at 2011-02-26 08:31:37 > 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