#include <iostream> #include <vector> #include <cmath> using namespace std; //等比数列求和 // 第一层 1 第二层 2 第三层由跳1阶和2阶组成以及跳3阶:4=2^2 第四层 有4+2+1(跳三阶)+1=8=2^3 //递归公式:dp[i] = dp[i-2]+dp[i-1]+...+dp[i-i]; //初始化: dp[0]=1,dp[1]=2 //遍历:从前向后 //验证:打印dp数组 int main() { int n,a; cin>>n; a=pow(2, n-1); printf("%d",a); return 0; } // 64 位输出请用 printf("%lld")