包AC的!
#include <iostream> #include <cmath> using namespace std; //直接使用公式 long long ji(int n) { return (1LL << n) - 1; // 2^n - 1 } int main() { int n; cin >> n; long long moves = ji(n); cout << moves << endl; return 0; }
注册一个 TeMenHu 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 TeMenHu 通用账户