QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#919680 | #5. 在线 O(1) 逆元 | yzy4090# | 0 | 0ms | 0kb | C++14 | 223b | 2025-02-28 12:02:37 | 2025-02-28 12:02:42 |
Judging History
answer
#include "inv.h"
#include<bits/stdc++.h>
typedef long long ll;
const int N=1e8+5;
int in[N];
void init(int p){
in[1]=1;
for(int i=2;i<=1e8;i++)
in[i]=(ll)in[p%i]*(p-p/i)%p;
}
int inv(int a){
return in[a];
}
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