QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#787975#5. 在线 O(1) 逆元dinnerWu100 ✓5536ms394516kbC++14193b2024-11-27 15:27:242024-11-27 15:27:30

Judging History

你现在查看的是最新测评结果

  • [2024-11-27 15:27:30]
  • 评测
  • 测评结果:100
  • 用时:5536ms
  • 内存:394516kb
  • [2024-11-27 15:27:24]
  • 提交

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