QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#714081#5. 在线 O(1) 逆元lgx5770 748ms4152kbC++14284b2024-11-05 21:35:232024-11-05 21:35:23

Judging History

你现在查看的是测评时间为 2024-11-05 21:35:23 的历史记录

  • [2024-11-05 22:08:19]
  • 管理员手动重测本题所有提交记录
  • 测评结果:80
  • 用时:5736ms
  • 内存:4260kb
  • [2024-11-05 21:35:23]
  • 评测
  • 测评结果:70
  • 用时:748ms
  • 内存:4152kb
  • [2024-11-05 21:35:23]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
const int N=100000;
int I[N];
void init(int p){
	I[1]=1;
	for (int i=2;i<N;i++) I[i]=mod-1ll*(mod/i)*I[mod%i]%mod;
}
int inv(int x){
	if (x<N) return I[x];
	else return mod-1ll*(mod/x)*inv(mod%x)%mod;
}

Details


Pretests


Final Tests

Test #1:

score: 30
Accepted
time: 9ms
memory: 4152kb

Test #2:

score: 40
Accepted
time: 748ms
memory: 4068kb

Test #3:

score: 0
Time Limit Exceeded