QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#624694 | #5. 在线 O(1) 逆元 | dww_1337 | 0 | 0ms | 0kb | C++14 | 232b | 2024-10-09 16:26:42 | 2024-11-05 22:04:36 |
Judging History
answer
#include "inv.h"
const int MAXN = 1e8 + 7;
int invt[MAXN];
void init(int p)
{
invt[1] = 1;
for(int i = 1 ; i <= MAXN ; i++) invt[i] = (long long)(p - p / i) * invt[p % i] % p;
}
int inv(int x)
{
return invt[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