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 nower at 2009-07-02 12:16:35 on Problem 1090
令f[n]表示将串a[1]到a[n]变为0的最小步数,f[0]=0,
令g[n]表示将串a[1]到a[n]变为a[1]到a[n-1]为0但a[n]为1的最小步数,g[0]=0
n>=1时,如果a[n]=0,f[n]=f[n-1];如果a[n]=1,f[n]=g[n-1]+2^(n-1);
n>=1时,如果a[n]=1,g[n]=f[n-1];如果a[n]=0,g[n]=g[n-1]+2^(n-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