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

公式很容易推导啊

Posted by peterdi at 2008-12-09 14:14:35 on Problem 2000
// 公式
//       1 2 3 4 5 6 7 8 9 10...
//      1 2 2 3 3 3 4 4 4 4...
// 对任意的day coinnum=1*1+2*2+3*3+...
// 所以得到day=n*(n+1)/2
// 由day求出n 判断n*(n+1)/2与day的关系	 
// 若相等则 coinnum=1*1+2*2+3*3+..+n*n=n*(n+1)*(2*n+1)/2
// 若不等则 coinnum+=day-n*(n+1)/2*(n+1)
// o(1)

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