QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#714081 | #5. 在线 O(1) 逆元 | lgx57 | 80 | 5736ms | 4260kb | C++14 | 284b | 2024-11-05 21:35:23 | 2024-11-05 22:08:19 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
const int N=100000;
int I[N];
void init(int p){
I[1]=1;
for (int i=2;i<N;i++) I[i]=mod-1ll*(mod/i)*I[mod%i]%mod;
}
int inv(int x){
if (x<N) return I[x];
else return mod-1ll*(mod/x)*inv(mod%x)%mod;
}
Details
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 8ms
memory: 4260kb
Test #2:
score: 20
Accepted
time: 719ms
memory: 4216kb
Test #3:
score: 30
Accepted
time: 3582ms
memory: 4164kb
Test #4:
score: 20
Accepted
time: 5736ms
memory: 4124kb
Test #5:
score: 0
Time Limit Exceeded