QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#102596#5. 在线 O(1) 逆元liuzhenhao0980 5156ms394504kbC++20343b2023-05-03 14:55:322024-11-05 21:49:22

Judging History

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

  • [2024-11-05 21:49:22]
  • 管理员手动重测本题所有提交记录
  • 测评结果:80
  • 用时:5156ms
  • 内存:394504kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-03 14:55:35]
  • 评测
  • 测评结果:70
  • 用时:2443ms
  • 内存:394144kb
  • [2023-05-03 14:55:32]
  • 提交

answer

#include<bits/stdc++.h>
#include "inv.h"
using namespace std;
const int MOD = 998244353;
int iv[100000010];
int inv(int x){
	if(x <= 100000000) return iv[x];
	return 1LL * inv(MOD % x) * (MOD - MOD / x) % MOD;
}
void init(int p){
	iv[1] = 1;
	for(int i = 2; i <= 100000000; i++) iv[i] = 1LL * (MOD - MOD / i) * iv[MOD % i] % MOD;
}

Details


Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 868ms
memory: 394504kb

Test #2:

score: 20
Accepted
time: 1435ms
memory: 394504kb

Test #3:

score: 30
Accepted
time: 3583ms
memory: 394504kb

Test #4:

score: 20
Accepted
time: 5156ms
memory: 394316kb

Test #5:

score: 0
Time Limit Exceeded