标签:
2 1 1
9
1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 21; 4 unsigned long long dp[maxn][maxn][maxn]; 5 int main() { 6 int N,A,B; 7 while(~scanf("%d%d%d",&N,&A,&B)) { 8 memset(dp,0,sizeof dp); 9 dp[0][0][0] = 1; 10 for(int i = 1; i <= N; ++i) 11 for(int j = 0; j <= A; ++j) 12 for(int k = 0; k <= B; ++k) 13 for(int a = 0; a <= j; ++a) 14 for(int b = 0; b <= k; ++b) 15 dp[i][j][k] += dp[i-1][a][b]; 16 unsigned long long ret = 0; 17 for(int i = 0; i <= A; ++i) 18 for(int j = 0; j <= B; ++j) 19 ret += dp[N][i][j]; 20 printf("%I64u\n",ret); 21 } 22 return 0; 23 }
标签:
原文地址:http://www.cnblogs.com/crackpotisback/p/4847334.html