提交时间:2023-12-09 10:28:58

运行 ID: 114858

#include<bits/stdc++.h> #define int unsigned long long using namespace std; int dp[114514]; signed main(){ int n,m; cin>>n>>m; dp[0] = 1; for (int i = 1;i <= n;i++){ for (int j = 1;j <= m;j++){ if (j > i){ break; } dp[i] += dp[i - j]; } } cout<<dp[n]; return 0; }