用户输出
25646167
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#48452 | #110. czq的模法数列 | Accepted | 100 | 25 ms | 276 K | C / 321 B | YUKI.N | 2021-05-14 19:39:37 |
#include <stdio.h>
int main(void) {
long long n = 0, q = 0, p = 0, current_term = 1, sum = 1;
scanf("%lld%lld%lld", &n, &q, &p);
for (int i = 0; i < n - 1; i++) {
current_term = (current_term * (q % p)) % p;
sum += current_term;
sum %= p;
}
printf("%lld", sum);
}
用户输出
192041748
系统信息
Exited with return code 0
用户输出
917164423
系统信息
Exited with return code 0
用户输出
626438667
系统信息
Exited with return code 0