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

贴个AC的

Posted by severinzhong at 2012-09-03 22:44:49 on Problem 1664
//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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator