QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#128659 | #5. 在线 O(1) 逆元 | Leasier | 30 | 1844ms | 3820kb | C++11 | 162b | 2023-07-21 14:37:45 | 2024-11-05 21:50:51 |
Judging History
answer
#include "inv.h"
int mod;
void init(int p){
mod = p;
}
int inv(int x){
if (x == 1) return 1;
return mod - 1ll * (mod / x) * inv(mod % x) % mod;
}
Details
Pretests
Final Tests
Test #1:
score: 10
Accepted
time: 19ms
memory: 3688kb
Test #2:
score: 20
Accepted
time: 1844ms
memory: 3820kb
Test #3:
score: 0
Time Limit Exceeded
Test #4:
score: 0
Time Limit Exceeded
Test #5:
score: 0
Time Limit Exceeded