解法:
暴力
#include <iostream>
#include <vector>
using namespace std;
#define endl '\n'int main() {ios::sync_with_stdio(false);cin.tie(0); cout.tie(0);int n;long long sum = 0, a;cin >> n;for (int i = 1; i <= n; i++) {a = 1;for (int j = 1; j <= i; j++) {a *= 2;}sum += a;}cout << sum << endl;return 0;
}