Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## Re:runtime error请高人指点（代码）

Posted by chenmingqiang at 2006-05-01 23:31:29 on Problem 2704
In Reply To:runtime error请高人指点（代码） Posted by:CULT at 2006-02-03 17:51:33
```> #include<stdio.h>
> #include<iostream>
>
> using namespace std;
>
> int main()
> {
> 	_int64 steps[34][34];
> 	int i,j,
> 		board[34][34],
> 		n;
>
> 	while(cin >> n && n!=-1)
> 	{
>
> 		for(i=0;i<n;i++)
> 		{
> 			for(j=0;j<n;j++)
> 			{
> 				cin>>board[i][j];
> 				steps[i][j]=0;
> 			}
> 		}
>
> 		steps[0][0]=1;
>
> 		for(i=0;i<n;i++)
> 		{
> 			for(j=0;j<n;j++)
> 			{
> 				if(steps[i][j]!=0&&board[i][j]!=0)
> 				{
> 					if(i+board[i][j]<n)
> 						steps[i+board[i][j]][j]+=steps[i][j];
> 					if(j+board[i][j]<n)
> 						steps[i][j+board[i][j]]+=steps[i][j];
> 				}
>
> 			}
> 		}
>
> 		printf("%I64d\n",steps[n-1][n-1]);
>
> 	}
>
> 	return 0;
>
> }
```

Followed by: