QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#468537#5. 在线 O(1) 逆元yzc35823015130 1414ms3876kbC++14241b2024-07-08 21:24:282024-11-05 22:00:08

Judging History

This is the latest submission verdict.

  • [2024-11-05 22:00:08]
  • 管理员手动重测本题所有提交记录
  • Verdict: 30
  • Time: 1414ms
  • Memory: 3876kb
  • [2024-07-08 21:24:28]
  • Judged
  • Verdict: 70
  • Time: 1413ms
  • Memory: 3848kb
  • [2024-07-08 21:24:28]
  • Submitted

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


Pretests


Final Tests

Test #1:

score: 10
Accepted
time: 18ms
memory: 3876kb

Test #2:

score: 20
Accepted
time: 1414ms
memory: 3752kb

Test #3:

score: 0
Time Limit Exceeded

Test #4:

score: 0
Time Limit Exceeded

Test #5:

score: 0
Time Limit Exceeded