QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#4937 | #5. 在线 O(1) 逆元 | Qingyu | 70 | 1864ms | 198828kb | C++11 | 348b | 2020-10-19 09:42:43 | 2021-12-19 05:38:27 |
Judging History
你现在查看的是测评时间为 2021-12-19 05:38:27 的历史记录
- [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:43]
- 提交
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: 791ms
memory: 198828kb
Test #2:
score: 40
Accepted
time: 1864ms
memory: 198824kb
Test #3:
score: 0
Time Limit Exceeded