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 |
公式很容易推导啊// 公式 // 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator