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 |
这题的递推式,欢迎大家讨论令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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator