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 mountainhigh at 2011-06-24 10:13:54 on Problem 1958
#include<iostream>
#include<cstring>
using namespace std;
int sav[13];
int main()
{
	int i,j,k;
	memset(sav,0,sizeof(sav));
	sav[0]=0;
	sav[1]=1;
	sav[2]=3;
	sav[3]=5;
	for(i=4;i<=12;i++)
	{
		int cnt=1000000,num=0;
		for(k=1;k<=i;k++)
		{
			int t=2*sav[i-k]+(1<<k)-1;
			if(t<cnt)cnt=t;
		}
		sav[i]=cnt;
	}
	for(i=1;i<=12;i++)
	cout<<sav[i]<<endl;
	return 0;
}

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