QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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];
}
详细
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