QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#101625 | #5. 在线 O(1) 逆元 | chenyikai | 0 | 0ms | 0kb | C++14 | 170b | 2023-04-30 15:14:50 | 2024-11-05 21:49:07 |
Judging History
answer
#include "inv.h"
int Inv[10000003];
void init(int p){
Inv[1]=0;
for(int i=2;i<=100000000;i++)Inv[i]=-1ll*Inv[p%i]*(p/i)%p+p;
}
int inv(int x){
return Inv[x];
}
Details
Pretests
Final Tests
Test #1:
score: 0
Runtime Error
Test #2:
score: 0
Runtime Error
Test #3:
score: 0
Runtime Error
Test #4:
score: 0
Runtime Error
Test #5:
score: 0
Runtime Error