QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#499434 | #5. 在线 O(1) 逆元 | lonelywolf | 30 | 2548ms | 3896kb | C++23 | 375b | 2024-07-31 14:10:51 | 2024-11-05 22:02:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int mod;
int qpow(int a, int b) {
int res = 1;
for (; b; b /= 2, a = 1ll * a * a % mod) {
if (b & 1) {
res = 1ll * res * a % mod;
}
}
return res;
}
void init(int p) {
mod = p;
}
int inv(int x) {
return qpow(x, mod - 2);
}
詳細信息
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 26ms
memory: 3896kb
Test #2:
score: 20
Accepted
time: 2548ms
memory: 3788kb
Test #3:
score: 0
Time Limit Exceeded
Test #4:
score: 0
Time Limit Exceeded
Test #5:
score: 0
Time Limit Exceeded