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 B10330224 at 2011-08-07 17:05:19 on Problem 1992
/*#include<stdio.h>
#include<string.h>
char map[1005][1005];
int dp[1005][1005];
int main()
{
    int t,i,j;
	int r,c;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d",&r,&c);
		for(i=1;i<=r;i++)
			for(j=1;j<=c;j++)
				scanf("%1s",&map[i][j]);
		memset(dp,0,sizeof(dp));
		for(i=1;i<=c;i++)
		{
			if(map[1][i]!='#')
			dp[1][i]=1;
			else break;
		}
		for(i=1;i<=r;i++)
		{
			if(map[i][1]!='#')
			dp[i][1]=1;
			else break;
		}
        for(i=1;i<=r;i++)
			for(j=1;j<=c;j++)
			{
				if(i-1>=1&&j-1>=1)
				{
					if(map[i][j-1]=='#')
						dp[i][j-1]=0;
					if(map[i-1][j]=='#')
						dp[i-1][j]=0;
					dp[i][j]=dp[i][j-1]+dp[i-1][j];
				}
			}
			printf("Existuje %d ruznych cest.\n",dp[r][c]);
	}
	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