QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#713872 | #5. 在线 O(1) 逆元 | lgx57 | 0 | 69ms | 81912kb | C++14 | 299b | 2024-11-05 20:46:28 | 2024-11-05 20:46:29 |
Judging History
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: 67ms
memory: 81892kb
Test #2:
score: 0
Wrong Answer
time: 67ms
memory: 81912kb
Test #3:
score: 0
Wrong Answer
time: 69ms
memory: 81772kb