mickypinata

AJJak-T001: Tiling-01

Dec 3rd, 2021
485
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long lli;
  5.  
  6. const int N = 90;
  7.  
  8. lli dp[N];
  9.  
  10. int main(){
  11.  
  12.     int row, col;
  13.     scanf("%d%d", &row, &col);
  14.     dp[0] = 1;
  15.     for(int i = 1; i <= row; ++i){
  16.         if(i >= col){
  17.             dp[i] = dp[i - 1] + dp[i - col];
  18.         } else {
  19.             dp[i] = dp[i - 1];
  20.         }
  21.     }
  22.     cout << dp[row];
  23.  
  24.     return 0;
  25. }
  26.  
RAW Paste Data