QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#468537#5. 在线 O(1) 逆元yzc35823015170 1413ms3848kbC++14241b2024-07-08 21:24:282024-07-08 21:24:28

Judging History

你现在查看的是测评时间为 2024-07-08 21:24:28 的历史记录

  • [2024-11-05 22:00:08]
  • 管理员手动重测本题所有提交记录
  • 测评结果:30
  • 用时:1414ms
  • 内存:3876kb
  • [2024-07-08 21:24:28]
  • 评测
  • 测评结果:70
  • 用时:1413ms
  • 内存:3848kb
  • [2024-07-08 21:24:28]
  • 提交

answer

#include"inv.h"
typedef long long ll;
#define MOD 998244353
int Inv[MOD];
void init(int p){
	Inv[1]=1;
}
int inv(int x){
	if(!x)
		return 0;
	else if(Inv[x])
		return Inv[x];
	else
		return (ll)(MOD-MOD/x)%MOD*inv(MOD%x)%MOD;
}

Details

Test #1:

score: 30
Accepted
time: 15ms
memory: 3784kb

Test #2:

score: 40
Accepted
time: 1413ms
memory: 3848kb

Test #3:

score: 0
Time Limit Exceeded