QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#850051 | #5. 在线 O(1) 逆元 | mnbvcxz123 | 30 | 1215ms | 3896kb | C++23 | 345b | 2025-01-09 20:00:08 | 2025-01-09 20:00:08 |
Judging History
answer
#include"inv.h"
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr int mod=998244353;
ll exp(ll a, ll w){
ll ret=1;
a%=mod;
while(w){
if(w&1)ret=ret*a%mod;
a=a*a%mod;
w>>=1;
}
return ret;
}
void init(int p){}
int inv(int x){
return exp(x,mod-2);
}
Details
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 13ms
memory: 3896kb
Test #2:
score: 20
Accepted
time: 1215ms
memory: 3688kb
Test #3:
score: 0
Time Limit Exceeded
Test #4:
score: 0
Time Limit Exceeded
Test #5:
score: 0
Time Limit Exceeded