1 条题解
- 
  0
#include <iostream> #include <cstdio> #include <iomanip> #include <cmath> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <queue> #define LL long long using namespace std; const int INF = 0x3f3f3f3f; const int N = 1e5 + 10; long long n , k , dp[20][2032]; int main() { cin >> n >> k; dp[0][0] = 1; for(int i = 1; i <= n; i++) { for(int j = k; j > 0; j--) { for(int l = i; l <= n; l++) { dp[j][l] = dp[j][l] + dp[j - 1][l - i]; } } } cout << dp[k][n]; return 0; } 
- 1
 
信息
- ID
 - 2227
 - 时间
 - 1000ms
 - 内存
 - 256MiB
 - 难度
 - 9
 - 标签
 - 递交数
 - 148
 - 已通过
 - 12
 - 上传者