QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#640619 | #5. 在线 O(1) 逆元 | Yu_mx | Compile Error | / | / | C++14 | 221b | 2024-10-14 14:48:25 | 2024-11-05 22:05:20 |
Judging History
你现在查看的是最新测评结果
- [2024-11-05 22:05:20]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-10-14 14:48:27]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-10-14 14:48:25]
- 提交
answer
#include"inv.h"
int mod;
void init(int p){
mod = p;
}
int inv(int x){
int p = mod;
int k = p-2;
int res = 1%p;
while(k){
if(k&1) res = 1LL*res*a%p;
k >>= 1;
a = 1LL*a*a%p;
}
return res;
}
Details
implementer.cpp: In function ‘int main()’: implementer.cpp:22:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ answer.code: In function ‘int inv(int)’: answer.code:14:39: error: ‘a’ was not declared in this scope 14 | if(k&1) res = 1LL*res*a%p; | ^ answer.code:16:17: error: ‘a’ was not declared in this scope 16 | a = 1LL*a*a%p; | ^