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 |
谢谢前辈对于n==0的情况提醒. 贴个递推关系.推了几次终于推出关系,可是结果就是不对, 一看前辈的帖子,原来n==0是1结果就完全对了! dp[0] = 1; dp[2] = 3; for(int i = 2; i <= n; i+=2) { dp[i] = dp[i-2]; for(int j = 0; j <= i-2; j+=2) dp[i] += 2*dp[j]; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator