QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#641199 | #5. 在线 O(1) 逆元 | Idtwtei | 0 | 21ms | 19148kb | C++14 | 281b | 2024-10-14 19:08:53 | 2024-11-05 22:06:30 |
Judging History
answer
#include"inv.h"
#include<bits/stdc++.h>
using namespace std;
const int MOD=998244353,N=MOD>>8;
int I[N];
void init(int p){ I[1]=1; for(int i=1;i<N;++i) I[i]=MOD-1ll*(MOD/i)*I[MOD%i]%MOD; }
int inv(int x){
if(x<N) return I[x];
return MOD-1ll*(MOD/x)*inv(MOD%x)%MOD;
}
Details
Pretests
Final Tests
Test #1:
score: 0
Wrong Answer
time: 21ms
memory: 19144kb
Test #2:
score: 0
Wrong Answer
time: 16ms
memory: 19128kb
Test #3:
score: 0
Wrong Answer
time: 14ms
memory: 19020kb
Test #4:
score: 0
Wrong Answer
time: 16ms
memory: 19148kb
Test #5:
score: 0
Wrong Answer
time: 13ms
memory: 19080kb