QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#641199#5. 在线 O(1) 逆元Idtwtei0 21ms19148kbC++14281b2024-10-14 19:08:532024-11-05 22:06:30

Judging History

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

  • [2024-11-05 22:06:30]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:21ms
  • 内存:19148kb
  • [2024-10-14 19:08:59]
  • 评测
  • 测评结果:0
  • 用时:30ms
  • 内存:19140kb
  • [2024-10-14 19:08:53]
  • 提交

answer

#include"inv.h"
#include<bits/stdc++.h>
using namespace std;

const int MOD=998244353,N=MOD>>8;
int I[N];

void init(int p){ I[1]=1; for(int i=1;i<N;++i) I[i]=MOD-1ll*(MOD/i)*I[MOD%i]%MOD; }
int inv(int x){
	if(x<N) return I[x];
	return MOD-1ll*(MOD/x)*inv(MOD%x)%MOD;
}

Details


Pretests


Final Tests

Test #1:

score: 0
Wrong Answer
time: 21ms
memory: 19144kb

Test #2:

score: 0
Wrong Answer
time: 16ms
memory: 19128kb

Test #3:

score: 0
Wrong Answer
time: 14ms
memory: 19020kb

Test #4:

score: 0
Wrong Answer
time: 16ms
memory: 19148kb

Test #5:

score: 0
Wrong Answer
time: 13ms
memory: 19080kb