QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#915619 | #5. 在线 O(1) 逆元 | Taiki0715 | 30 | 1269ms | 3840kb | C++20 | 286b | 2025-02-26 14:28:02 | 2025-02-26 14:28:03 |
Judging History
answer
#include<iostream>
#include<cassert>
#include "inv.h"
using ll=long long;
constexpr ll mod=998244353;
void init(int p){
assert(p==mod);
}
int inv(int x){
ll res=1;
ll p=mod-2;
while(p){
if(p&1)res=res*x%mod;
x=ll(x)*x%mod;
p>>=1;
}
return res;
}
Details
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 12ms
memory: 3712kb
Test #2:
score: 20
Accepted
time: 1269ms
memory: 3840kb
Test #3:
score: 0
Time Limit Exceeded
Test #4:
score: 0
Time Limit Exceeded
Test #5:
score: 0
Time Limit Exceeded