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

谢谢前辈对于n==0的情况提醒. 贴个递推关系.

Posted by intheway at 2009-07-06 21:07:42 on Problem 2663
推了几次终于推出关系,可是结果就是不对, 一看前辈的帖子,原来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:
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