QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#241452 | #5. 在线 O(1) 逆元 | mfeitveer | Compile Error | / | / | C++14 | 373b | 2023-11-06 07:51:28 | 2023-11-06 07:51:30 |
Judging History
你现在查看的是测评时间为 2023-11-06 07:51:30 的历史记录
- [2024-11-05 21:54:24]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-11-06 07:51:30]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-11-06 07:51:28]
- 提交
answer
#include "inv.h"
#include <map>
using namespace std;
const int N = 10000010;
const int mod = 998244353;
typedef long long ll;
unordered_map<int, int> mp;
ll Inv[N];
ll ask(ll x)
{
if(mp.find(x)) return mp[x];
return mp[x] = (mod - mod / x) * ask(mod % x) % mod;
}
void init(int p)
{
mp[1] = 1;
}
int inv(int x)
{
return ask(x);
}
詳細信息
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:10:1: error: ‘unordered_map’ does not name a type 10 | unordered_map<int, int> mp; | ^~~~~~~~~~~~~ answer.code: In function ‘ll ask(ll)’: answer.code:16:8: error: ‘mp’ was not declared in this scope 16 | if(mp.find(x)) return mp[x]; | ^~ answer.code:17:12: error: ‘mp’ was not declared in this scope 17 | return mp[x] = (mod - mod / x) * ask(mod % x) % mod; | ^~ answer.code: In function ‘void init(int)’: answer.code:22:9: error: ‘mp’ was not declared in this scope; did you mean ‘p’? 22 | mp[1] = 1; | ^~ | p