QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#4942#5. 在线 O(1) 逆元zombie46280 5127ms511728kbC++11309b2020-10-19 09:44:412024-11-05 21:45:59

Judging History

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

  • [2024-11-05 21:45:59]
  • 管理员手动重测本题所有提交记录
  • 测评结果:80
  • 用时:5127ms
  • 内存:511728kb
  • [2024-11-05 21:42:46]
  • 管理员手动重测本题所有提交记录
  • 测评结果:100
  • 用时:5949ms
  • 内存:511696kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2021-12-19 05:39:41]
  • 评测
  • 测评结果:70
  • 用时:2781ms
  • 内存:511328kb
  • [2020-10-19 09:44:41]
  • 提交

answer

#include <bits/stdc++.h>
#include "inv.h"
using namespace std;
const int mod=998244353;
const int N=130000010;
int invv[N];
int inv(int a){
	return a<N?invv[a]:1LL*(mod-mod/a)*inv(mod%a)%mod;
}
void init(int p){
	invv[0]=invv[1]=1;
	for (int i=2;i<N;++i) invv[i]=1LL*(mod-mod/i)*invv[mod%i]%mod;
}

Details


Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 949ms
memory: 511604kb

Test #2:

score: 20
Accepted
time: 1579ms
memory: 511728kb

Test #3:

score: 30
Accepted
time: 3597ms
memory: 511712kb

Test #4:

score: 20
Accepted
time: 5127ms
memory: 511600kb

Test #5:

score: 0
Time Limit Exceeded