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 |
贴个AC的//poj1664 #include <stdio.h> int dp[11][11][11]; int main(){ dp[0][0][0]=1; for(int n=1;n<11;n++) for(int k=0;k<11;k++) for(int m=k;m<11;m++) for(int kk=0;kk<=k;kk++) dp[m][n][k]+=dp[m-k][n-1][kk]; int t; scanf("%d",&t); while(t--) { int sum=0,n,m; scanf("%d%d",&m,&n); for(int i=1;i<=m;i++) sum+=dp[m][n][i]; printf("%d\n",sum); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator