Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- int32_t main() {
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- int n;
- cin >> n;
- __int128_t f = 1, v = 4, a = 4;
- while(n--) {
- v = v + a + f;
- f *= 4;
- a = v + f - 1;
- }
- vector<int> ans;
- while(v) {
- ans.push_back(v % 10);
- v /= 10;
- }
- for(int i = (int)ans.size() - 1; i >= 0; i--)
- cout << ans[i];
- cout << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment