QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#629275 | #5. 在线 O(1) 逆元 | 7_divided_by_3 | 30 | 2472ms | 3884kb | C++20 | 322b | 2024-10-11 10:11:49 | 2024-11-05 22:05:19 |
Judging History
answer
int modp;
void init(int p)
{
modp=p;
}
constexpr long long powp(long long a,long long b,long long p)
{
long long res=1;
a%=p;
while(b)
{
if(b&1)res=(res*a)%p;
a=(a*a)%p;
b>>=1;
}
return res;
}
int inv(int x)
{
return powp(x,modp-2,modp);
}
Details
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 25ms
memory: 3840kb
Test #2:
score: 20
Accepted
time: 2472ms
memory: 3884kb
Test #3:
score: 0
Time Limit Exceeded
Test #4:
score: 0
Time Limit Exceeded
Test #5:
score: 0
Time Limit Exceeded