QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#641199 | #5. 在线 O(1) 逆元 | Idtwtei | 0 | 30ms | 19140kb | C++14 | 281b | 2024-10-14 19:08:53 | 2024-10-14 19:08:59 |
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: 24ms
memory: 19064kb
Test #2:
score: 0
Wrong Answer
time: 19ms
memory: 19140kb
Test #3:
score: 0
Wrong Answer
time: 30ms
memory: 18992kb