QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#209292 | #5. 在线 O(1) 逆元 | fstqwq | 0 | 0ms | 0kb | C++14 | 296b | 2023-10-10 13:45:46 | 2024-11-05 21:53:02 |
Judging History
answer
const int mod = 998244353;
const int pre = mod / 100;
int a[pre];
void init(int p) {
a[0] = a[1] = 1;
for (int i = 2; i < pre; i++) {
a[i] = 1ll * (i - i / mod) * a[i % mod] % mod;
}
}
int inv(int x) { return x < pre ? a[x] : int(1ll * (x - x / mod) * inv(x % mod) % mod); }
Details
Pretests
Final Tests
Test #1:
score: 0
Memory Limit Exceeded
Test #2:
score: 0
Memory Limit Exceeded
Test #3:
score: 0
Memory Limit Exceeded
Test #4:
score: 0
Memory Limit Exceeded
Test #5:
score: 0
Memory Limit Exceeded