mynameishandsome

Untitled

Jul 5th, 2021 (edited)
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int n;
  5. int hihihoho(){
  6.     int idx = n-1;
  7.     int lmao = 0;
  8.     int bada = 0;
  9.     vector <int> dp;
  10.     for(int i = 1; i <= n; i++){
  11.         dp.push_back(i);
  12.     }
  13.     for(int i = 0; i < n-1; i++){
  14.         for(int j = lmao; j!= idx; j++){
  15.             dp.push_back(dp[j]+dp[j+1]);
  16.         }
  17.     lmao = idx - bada + 1;
  18.     idx = dp.size()-1;
  19.     }
  20.     return dp[dp.size()-1];
  21. }
  22.  
  23. int main()
  24. {
  25.     ios_base::sync_with_stdio(0);
  26.     cin.tie(0);
  27.     cin >> n;
  28.     cout << hihihoho();
  29.     return 0;
  30. }
  31.  
  32.  
  33.  
Add Comment
Please, Sign In to add comment