Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
127830 | 凌艺樽 | 单峰排列 | C++ | 通过 | 100 | 0 MS | 244 KB | 415 | 2024-01-25 10:32:42 |
#include <bits/stdc++.h> using namespace std; #define LL long long const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; LL power(LL a,LL b,LL p) { if(a==0) return 0; if(b==1) return 0; LL ans=1; while(b!=0) { if(b%2 ==1) { ans=(ans*a)%p; } b/=2; a=(a*a)%p; } return ans%p; } int main () { LL a,b,p; cin >>b; p=1234567; cout << power(2,b-1,p); return 0; }