QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#288060#5. 在线 O(1) 逆元ScapeGoatTree0 0ms0kbC++14274b2023-12-21 17:34:232024-11-05 21:56:28

Judging History

This is the latest submission verdict.

  • [2024-11-05 21:56:28]
  • 管理员手动重测本题所有提交记录
  • Verdict: 0
  • Time: 0ms
  • Memory: 0kb
  • [2023-12-21 17:34:25]
  • Judged
  • Verdict: 0
  • Time: 0ms
  • Memory: 0kb
  • [2023-12-21 17:34:23]
  • Submitted

answer

#include "inv.h"
//#define int long long
const int MOD=998244353;
const int MAXN=1e8+5;
int inv1[MAXN];
void init(int p){
	inv1[1]=1;
	for(int i=2;i<=MAXN;i++){
		int k=p/i;
		int r=p%i;
		inv1[i]=1ll*(p-k)*inv1[r]%MOD;
	}
}
int inv(int x){
	return inv1[x];
}

Details


Pretests


Final Tests

Test #1:

score: 0
Runtime Error

Test #2:

score: 0
Runtime Error

Test #3:

score: 0
Runtime Error

Test #4:

score: 0
Runtime Error

Test #5:

score: 0
Runtime Error