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 killua_hzl at 2009-04-06 01:01:43 on Problem 1906
void getList()
{
	int i,j;
	len[0]=len[1]=1;
	num[0][1]=1;
	num[1][1]=3;
	int c=0,t;
	for(i=2;i<=65;i++)
	{
		len[i]=len[i-1];
		for(j=1;j<=len[i-1];j++)
		{
			t=num[i-1][j]*3;
			num[i][j+1]=(num[i][j]+t)/10;
			num[i][j]=(num[i][j]+t)%10;
			
		}
		if(num[i][j]) len[i]++;
	}
}
========================================================

void getList()
{
	int i,j;
	len[0]=1;
	num[0][1]=1;
	int t;
	for(i=1;i<=65;i++)
	{
		len[i]=len[i-1];
		for(j=1;j<=len[i-1];j++)
		{
			t=num[i-1][j]*3;
			num[i][j+1]+=(num[i][j]+t)/10;
			num[i][j]=(num[i][j]+t)%10;
			
		}
		if(num[i][j]) len[i]++;
	}
}
==================================================================
一个AC,一个WA.........

就是一个从2开始,一个从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