QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#468525 | #5. 在线 O(1) 逆元 | yzc358230151 | Compile Error | / | / | C++14 | 275b | 2024-07-08 21:20:25 | 2024-11-05 21:59:57 |
Judging History
你现在查看的是最新测评结果
- [2024-11-05 21:59:57]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-07-08 21:20:25]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-07-08 21:20:25]
- 提交
answer
#include"inv.h"
#include<unordered_map>
typedef long long ll;
int MOD;
unordered_map<int,int>Inv;
void init(int p){
MOD=p,
Inv[1]=1;
}
int inv(int x){
if(!x)
return 0;
else if(Inv[x])
return Inv[x];
else
return (ll)(MOD-MOD/x)%MOD*inv(MOD%x)%MOD;
}
详细
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:5:1: error: ‘unordered_map’ does not name a type 5 | unordered_map<int,int>Inv; | ^~~~~~~~~~~~~ answer.code: In function ‘void init(int)’: answer.code:8:9: error: ‘Inv’ was not declared in this scope; did you mean ‘inv’? 8 | Inv[1]=1; | ^~~ | inv answer.code: In function ‘int inv(int)’: answer.code:13:17: error: ‘Inv’ was not declared in this scope; did you mean ‘inv’? 13 | else if(Inv[x]) | ^~~ | inv