QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#624780 | #5. 在线 O(1) 逆元 | dww_1337 | 0 | 0ms | 0kb | C++14 | 224b | 2024-10-09 16:36:39 | 2024-10-09 16:36:44 |
Judging History
answer
#include "inv.h"
const int MAXN = 1e8 + 7;
int invt[MAXN];
void init(int p)
{
invt[1] = 1;
for(int i = 2 ; i < MAXN ; i++) invt[i] = p - 1ll * 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