23 lines
245 B
C++
23 lines
245 B
C++
#include <bits/stdc++.h>
|
|
#define endl '\n'
|
|
using namespace std;
|
|
|
|
int n;
|
|
|
|
int main(){
|
|
cin >> n;
|
|
|
|
int cnt = 0;
|
|
int curr = 1;
|
|
|
|
for(int i = 2; i <= n; i++){
|
|
// 第i格有多少米
|
|
curr = curr * 2;
|
|
cnt += curr;
|
|
}
|
|
|
|
cout << cnt;
|
|
return 0;
|
|
}
|
|
|