用户输出
25646167
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#100440 | #110. czq的模法数列 | Accepted | 100 | 46 ms | 388 K | C++ 11 / 329 B | 计试001-王泽俊 | 2023-07-24 20:45:00 |
#include <iostream>
#include <cstring>
#include <iomanip>
#include <math.h>
#include <climits>
using namespace std;
int main() {
int n, q, p;
cin >> n >> q >> p;
long long temp = 1;
long long result = 1;
for (int i = 1; i < n; ++i) {
temp = temp * q % p;
result = (result + temp) % p;
}
cout << result;
return 0;
}
用户输出
192041748
系统信息
Exited with return code 0
用户输出
917164423
系统信息
Exited with return code 0
用户输出
626438667
系统信息
Exited with return code 0