QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#713872 | #5. 在线 O(1) 逆元 | lgx57 | 0 | 98ms | 82036kb | C++14 | 299b | 2024-11-05 20:46:28 | 2024-11-05 22:08:18 |
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: 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