标签:des c style class blog code
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2594 Accepted Submission(s): 1528
1 6 6 4 5 6 6 4 3 2 2 3 1 7 2 1 1 4 6 2 7 5 8 4 3 9 5 7 6 6 2 1 5 3 1 1 3 7 2
3948
<span style="font-size:18px;">#include <cstdio> #include <cstring> int map[101][101]; int dp[101][101]; int main() { int i,j,k,l,m,n,t,temp; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); for(i=1;i<=n;i++) for(j=1;j<=m;j++) scanf("%d",&map[i][j]); memset(dp,0,sizeof(dp)); dp[1][1]=1; for(i=1;i<=n;i++) { for(j=1;j<=m;j++) { temp=map[i][j]; for(k=0;k<=temp&&k+i<=n;k++) // for(l=0;l+k<=temp&&l+j<=m;l++) // { if(k==0&&l==0) continue; dp[k+i][l+j]=(dp[k+i][l+j]+dp[i][j])%10000; } } } printf("%d\n",dp[n][m]); } return 0; }</span>
hdu 1978 How many ways,布布扣,bubuko.com
标签:des c style class blog code
原文地址:http://blog.csdn.net/fyxz1314/article/details/29615959