QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#917954 | #5. 在线 O(1) 逆元 | Shumomo# | 0 | 0ms | 0kb | C++14 | 184b | 2025-02-27 16:13:19 | 2025-02-27 16:13:21 |
Judging History
answer
#include "inv.h"
int in[100000009];
void init(int p){
long long mod=p;
in[1]=1;
for(int i=2;i<=100000000;i++)in[i]=(p-p/i)*in[p%i]%p;
}
int inv(int x){return in[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