QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#787975 | #5. 在线 O(1) 逆元 | dinnerWu | 100 ✓ | 5536ms | 394516kb | C++14 | 193b | 2024-11-27 15:27:24 | 2024-11-27 15:27:30 |
Judging History
answer
#import"inv.h"
const int m=998244353;int f[100000000],i=f[1]=1;void init(int p){for(;++i<1e8;f[i]=(long long)(m-m/i)*f[m%i]%m);}int inv(int x){return x<1e8?f[x]:(long long)(m-m/x)*inv(m%x)%m;}
詳細信息
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 705ms
memory: 394460kb
Test #2:
score: 20
Accepted
time: 1176ms
memory: 394408kb
Test #3:
score: 30
Accepted
time: 3138ms
memory: 394516kb
Test #4:
score: 20
Accepted
time: 4584ms
memory: 394508kb
Test #5:
score: 20
Accepted
time: 5536ms
memory: 394408kb