Advertisement
Mirbek

ТЫЙЫНДАР

Jan 18th, 2022
600
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. const int N = 1e6 + 5;
  6.  
  7. long long n, dp[N];
  8.  
  9. int main(){
  10.     ios::sync_with_stdio(0);
  11.  
  12.     cin >> n;
  13.  
  14.     dp[0] = 1;
  15.  
  16.     for (int i = 1; i <= n; i++) {
  17.         dp[i] += dp[i - 1];
  18.     }
  19.     for (int i = 5; i <= n; i++) {
  20.         dp[i] += dp[i - 5];
  21.     }
  22.     for (int i = 10; i <= n; i++) {
  23.         dp[i] += dp[i - 10];
  24.     }
  25.  
  26.     cout << dp[n] << endl;
  27. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement