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

## printf("%lld\n" , f[n][n]);改成 printf("%I64d\n" , f[n][n]);就可以了 ....

Posted by huicpc16 at 2005-11-10 14:48:55 on Problem 2704
In Reply To:Re:为什么我还是WA 啊？请高手帮帮忙看看（附程序） Posted by:ericsummer at 2005-11-10 14:32:03
```> #include <stdio.h>
> #include <iostream.h>
> #define maxn 35
>
> char a[maxn][maxn];
> _int64 f[maxn][maxn];
>
>
>
> int n;
>
> int main()
> {
> 	int i ,j ,k , m;
> 	while(cin>>n &&n!=-1)
> 	{
> 		for(i=1 ; i<=n ; i++)
> 			for(j=1 ;j<=n ;j++)
> 			{
> 				cin >> a[i][j];
> 				f[i][j]=0;
> 			}
> 			f[1][1] =1;
>         for(i=1 ; i<=n ;i++)
> 		{
> 			for(j=1 ; j<=n ;j++)
> 			{
> 				for(k =1 ; k<=i-1 ;k++)
> 					if(i-k==a[k][j]-'0')
> 						f[i][j] += f[k][j];
>                 for(m =1 ; m<=j-1 ;m++)
> 					if(j-m == a[i][m]-'0')
> 						f[i][j] += f[i][m];
> 			}
> 		}
>
> 		printf("%lld\n" , f[n][n]);
> 	}
> 	return 0;
>
> }
>
```

Followed by: