QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#288060 | #5. 在线 O(1) 逆元 | ScapeGoatTree | 0 | 0ms | 0kb | C++14 | 274b | 2023-12-21 17:34:23 | 2024-11-05 21:56:28 |
Judging History
answer
#include "inv.h"
//#define int long long
const int MOD=998244353;
const int MAXN=1e8+5;
int inv1[MAXN];
void init(int p){
inv1[1]=1;
for(int i=2;i<=MAXN;i++){
int k=p/i;
int r=p%i;
inv1[i]=1ll*(p-k)*inv1[r]%MOD;
}
}
int inv(int x){
return inv1[x];
}
Details
Pretests
Final Tests
Test #1:
score: 0
Runtime Error
Test #2:
score: 0
Runtime Error
Test #3:
score: 0
Runtime Error
Test #4:
score: 0
Runtime Error
Test #5:
score: 0
Runtime Error