提交时间:2023-12-14 13:38:44

运行 ID: 115835

# include <bits/stdc++.h> using namespace std ; int dp [114514] = {1} ; int main ( ) { int a , b ; cin >> a >> b ; for ( int i = 1 ; i <= a ; i ++ ) { for ( int j = 1 ; j <= b ; j ++ ) { if ( i - j >= 0 ) { dp [i] += dp [i - j] ; } } } cout << dp [a] << endl ; return 0 ; }