QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#241466 | #5. 在线 O(1) 逆元 | mfeitveer | Compile Error | / | / | C++14 | 421b | 2023-11-06 08:12:46 | 2023-11-06 08:12:47 |
Judging History
你现在查看的是测评时间为 2023-11-06 08:12:47 的历史记录
- [2024-11-05 21:54:57]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-11-06 08:12:47]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-11-06 08:12:46]
- 提交
answer
#include "inv.h"
const int N = 130000010;
const int mod = 998244353;
typedef long long ll;
int Inv[N];
ll ask(ll x) {
ll res = 1;
while(x > 130000000)
res = res * (mod - mod / x) % mod, x = mod % x;
return res * inv[x] % mod;
}
void init(int p) {
Inv[1] = 1;
for(int i = 2;i <= 130000000;i++)
Inv[i] = 1ll * (mod - mod / i) * Inv[mod % i] % mod;
}
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: In function ‘ll ask(ll)’: answer.code:14:27: warning: pointer to a function used in arithmetic [-Wpointer-arith] 14 | return res * inv[x] % mod; | ^ answer.code:14:20: error: invalid operands of types ‘ll’ {aka ‘long long int’} and ‘int(int)’ to binary ‘operator*’ 14 | return res * inv[x] % mod; | ~~~ ^ ~~~~~~ | | | | | int(int) | ll {aka long long int}