Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
127843 | 廖悦扬 | 单峰排列 | C++ | 通过 | 100 | 0 MS | 248 KB | 359 | 2024-01-25 10:37:48 |
#include <bits/stdc++.h> #define int long long using namespace std; int n; int fp(int n, int x) { if (x==0) return 1; if (x%2==0) { long long tmp =fp(n, x/2); return tmp * tmp%1234567; } return fp(n, x-1)*n%1234567; } signed main() { scanf("%lld", &n); printf("%lld", fp(2, n-1)%1234567); return 0; }