QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#23827 | #5. 在线 O(1) 逆元 | feecle6418 | 100 ✓ | 5991ms | 160132kb | C++20 | 322b | 2022-03-19 16:35:48 | 2024-11-05 21:46:34 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2022-03-19 16:35:48]
- 提交
answer
#include<bits/stdc++.h>
#include"inv.h"
using namespace std;
typedef long long ll;
const int mod=998244353;
int ny[40000005];
int inv(int x){
if(x<=40000000)return ny[x];
return 1ll*inv(mod%x)*(mod-mod/x)%mod;
}
void init(int p){
ny[1]=1;
for(int i=2;i<=40000000;i++)ny[i]=1ll*ny[mod%i]*(mod-mod/i)%mod;
}
詳細信息
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 336ms
memory: 160064kb
Test #2:
score: 20
Accepted
time: 898ms
memory: 159948kb
Test #3:
score: 30
Accepted
time: 3197ms
memory: 160020kb
Test #4:
score: 20
Accepted
time: 4881ms
memory: 159940kb
Test #5:
score: 20
Accepted
time: 5991ms
memory: 160132kb