QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#713872#5. 在线 O(1) 逆元lgx570 98ms82036kbC++14299b2024-11-05 20:46:282024-11-05 22:08:18

Judging History

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

  • [2024-11-05 22:08:18]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:98ms
  • 内存:82036kb
  • [2024-11-05 20:46:29]
  • 评测
  • 测评结果:0
  • 用时:69ms
  • 内存:81912kb
  • [2024-11-05 20:46:28]
  • 提交

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;
}

详细


Pretests


Final Tests

Test #1:

score: 0
Wrong Answer
time: 87ms
memory: 82036kb

Test #2:

score: 0
Wrong Answer
time: 91ms
memory: 82036kb

Test #3:

score: 0
Wrong Answer
time: 96ms
memory: 82024kb

Test #4:

score: 0
Wrong Answer
time: 98ms
memory: 82020kb

Test #5:

score: 0
Wrong Answer
time: 98ms
memory: 82028kb