QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#705418 | #5. 在线 O(1) 逆元 | lvliang | Compile Error | / | / | C++14 | 347b | 2024-11-02 23:24:50 | 2024-11-05 22:07:54 |
Judging History
This is the latest submission verdict.
- [2024-11-05 22:07:54]
- 管理员手动重测本题所有提交记录
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-11-02 23:24:51]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-11-02 23:24:50]
- Submitted
answer
int quickPow(int base, int power, int mod) {
int result = 1;
base = base % mod;
while (power > 0) {
if (power & 1) {
result = (result * base) % mod;
}
base = (base * base) % mod;
power >>= 1;
}
return result;
}
int inv(int x) {
return quickPow(x, MOD - 2, MOD);
}
詳細信息
implementer.cpp: In function ‘int main()’: implementer.cpp:22:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ answer.code: In function ‘int inv(int)’: answer.code:15:24: error: ‘MOD’ was not declared in this scope 15 | return quickPow(x, MOD - 2, MOD); | ^~~