QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#128659 | #5. 在线 O(1) 逆元 | Leasier | 70 | 1861ms | 3712kb | C++11 | 162b | 2023-07-21 14:37:45 | 2023-07-21 14:37:52 |
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
Test #1:
score: 30
Accepted
time: 17ms
memory: 3604kb
Test #2:
score: 40
Accepted
time: 1861ms
memory: 3712kb
Test #3:
score: 0
Time Limit Exceeded