QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#713808 | #5. 在线 O(1) 逆元 | lgx57 | 70 | 1183ms | 3732kb | C++14 | 272b | 2024-11-05 20:35:45 | 2024-11-05 20:35:46 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mod=998244353;
void init(int p){
}
int inv(int x){
ll base=x,ans=1,k=mod-2;
while (k){
if (k&1){
ans=(ans*base)%mod;
}
base=(base*base)%mod;
k>>=1;
}
return ans;
}
Details
Pretests
Final Tests
Test #1:
score: 30
Accepted
time: 12ms
memory: 3688kb
Test #2:
score: 40
Accepted
time: 1183ms
memory: 3732kb
Test #3:
score: 0
Time Limit Exceeded