Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
printf("%lld\n" , f[n][n]);改成 printf("%I64d\n" , f[n][n]);就可以了 ....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:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator