QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#4938 | #5. 在线 O(1) 逆元 | Lenstar | 70 | 1987ms | 198924kb | C++11 | 348b | 2020-10-19 09:42:52 | 2021-12-19 05:38:42 |
Judging History
你现在查看的是测评时间为 2021-12-19 05:38:42 的历史记录
- [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:52]
- 提交
answer
#include <bits/stdc++.h>
#include "inv.h"
const int N = 5e7 + 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;
}
Details
Test #1:
score: 30
Accepted
time: 854ms
memory: 198924kb
Test #2:
score: 40
Accepted
time: 1987ms
memory: 198828kb
Test #3:
score: 0
Time Limit Exceeded