Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
128601 | mairuisheng | 单峰排列 | C++ | 通过 | 100 | 0 MS | 256 KB | 426 | 2024-01-25 21:12:19 |
#include<bits/stdc++.h> #define int long long #define P 1234567 using namespace std; int n; int qpow(int x,int y) { int ans=1,b=x; while(y!=0) { if(y&1) ans=ans*b%P; b=b*b%P; y>>=1; } return ans; } signed main(){ scanf("%lld",&n); if(n==1) { printf("1"); return 0; } printf("%lld",qpow(2,n-1)); return 0; }