Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n;
- int hihihoho(){
- int idx = n-1;
- int lmao = 0;
- int bada = 0;
- vector <int> dp;
- for(int i = 1; i <= n; i++){
- dp.push_back(i);
- }
- for(int i = 0; i < n-1; i++){
- for(int j = lmao; j!= idx; j++){
- dp.push_back(dp[j]+dp[j+1]);
- }
- lmao = idx - bada + 1;
- idx = dp.size()-1;
- }
- return dp[dp.size()-1];
- }
- int main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cin >> n;
- cout << hihihoho();
- return 0;
- }
Add Comment
Please, Sign In to add comment