b站视频
https://www.bilibili.com/video/BV1Rq4y1v7sC/
#include <bits/stdc++.h>
using namespace std;
int n, m = 1, a[100] = {0, 1};
int main() {
cin >> n;
for (int i = 1; i <= n + 1; i ++) {
int t = 0;
for (int j = 1; j <= m; j ++) {
t += a[j] * 2;
a[j] = t % 10;
t /= 10;
}
if (t > 0) a[++ m] = t;
}
a[1] -= 2;
for (int i = m; i >= 1; i --) cout << a[i];
return 0;
}