QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#4935 | #5. 在线 O(1) 逆元 | Lenstar | 80 | 4951ms | 42944kb | C++11 | 348b | 2020-10-19 09:42:08 | 2024-11-05 21:42:05 |
Judging History
你现在查看的是测评时间为 2024-11-05 21:42:05 的历史记录
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2020-10-19 09:42:08]
- 提交
answer
#include <bits/stdc++.h>
#include "inv.h"
const int N = 1e7 + 10, Mod = 998244353;
int Inv[N];
void init(int p)
{
Inv[0] = Inv[1] = 1;
for (int i = 2; i < N; ++i) Inv[i] = 1LL * (Mod - Mod / i) * Inv[Mod % i] % Mod;
}
int inv(int a)
{
if (a < N) return Inv[a];
return 1LL * (Mod - Mod / a) * inv(Mod % a) % Mod;
}
詳細信息
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 62ms
memory: 42940kb
Test #2:
score: 20
Accepted
time: 668ms
memory: 42944kb
Test #3:
score: 30
Accepted
time: 3169ms
memory: 42884kb
Test #4:
score: 20
Accepted
time: 4951ms
memory: 42756kb
Test #5:
score: 0
Time Limit Exceeded