Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long lli;
- const int N = 90;
- lli dp[N];
- int main(){
- int row, col;
- scanf("%d%d", &row, &col);
- dp[0] = 1;
- for(int i = 1; i <= row; ++i){
- if(i >= col){
- dp[i] = dp[i - 1] + dp[i - col];
- } else {
- dp[i] = dp[i - 1];
- }
- }
- cout << dp[row];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement