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

比较慢(16ms)的公式: f(n, m)=f(n-2^k, m)+f(n-2^(k+1), m-2^(k+1))

Posted by lddlinan at 2020-09-17 13:43:46 on Problem 1430
   f(n, m)
=  m*f(n-1, m)+f(n-1,m-1)
=  m*(m*f(n-2, m)+f(n-2, m-1))+(m-1)*f(n-2, m-1)+f(n-2, m-2)
=  m*f(n-2, m) + f(n-2, m-1)+ f(n-2, m-2)
=  f(n-1, m) + f(n-2, m-2)
=  f(n-2, m) + f(n-3, m-2) + f(n-3, m-2) + f(n-4, m-4)
=  f(n-2, m) + f(n-4, m-4)
=  f(n-4, m) + f(n-8, m-8)
...
=  f(n-2^k, m) + f(n-2^(k+1), m-2^(k+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