QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#713872#5. 在线 O(1) 逆元lgx570 69ms81912kbC++14299b2024-11-05 20:46:282024-11-05 20:46:29

Judging History

This is a historical verdict posted at 2024-11-05 20:46:29.

  • [2024-11-05 22:08:18]
  • 管理员手动重测本题所有提交记录
  • Verdict: 0
  • Time: 98ms
  • Memory: 82036kb
  • [2024-11-05 20:46:29]
  • Judged
  • Verdict: 0
  • Time: 69ms
  • Memory: 81912kb
  • [2024-11-05 20:46:28]
  • Submitted

answer

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mod=998244353;
const int N=10000000;
ll I[N];
void init(int p){
	I[1]=1;
	for (int i=2;i<N;i++) I[i]=mod-(mod/i)*I[mod%i]%mod;
}
int inv(int x){
	if (x<N) return I[x];
	else return mod-(mod/x)*inv(mod%x)%mod;
}

Details


Pretests


Final Tests

Test #1:

score: 0
Wrong Answer
time: 67ms
memory: 81892kb

Test #2:

score: 0
Wrong Answer
time: 67ms
memory: 81912kb

Test #3:

score: 0
Wrong Answer
time: 69ms
memory: 81772kb