用户输出
25646167
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#68647 | #110. czq的模法数列 | Accepted | 100 | 34 ms | 384 K | C++ / 292 B | 该起什么名字 | 2022-04-04 3:00:16 |
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
int main() {
std::ios::sync_with_stdio(false);
long long n, q, p;
cin >> n >> q >> p;
long long ans = 0, w = 1;
for (int i = 1; i <= n; i++) {
ans = (ans % p + w % p) % p;
w = (w % p) * (q % p) % p;
}
cout << ans;
return 0;
}
用户输出
192041748
系统信息
Exited with return code 0
用户输出
917164423
系统信息
Exited with return code 0
用户输出
626438667
系统信息
Exited with return code 0