QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#534327 | #5. 在线 O(1) 逆元 | surgutti | Compile Error | / | / | C++14 | 373b | 2024-08-27 02:41:22 | 2024-11-05 22:03:16 |
Judging History
你现在查看的是最新测评结果
- [2024-11-05 22:03:16]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-08-27 02:41:23]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-08-27 02:41:22]
- 提交
answer
#include "inv.h"
constexpr int N = 100000000 + 1;
constexpr int mod = 998244353;
int inverse[N];
void init(int p) {
assert(p == mod);
inverse[1] = 1;
for (int i = 2; i < N; i++)
inverse[i] = (mod - mod / i * inverse[mod % i] % mod) % mod;
}
int inv(int x) {
if (x < N)
return inverse[x];
return (mod - mod / x * inv(mod % x) % mod) % mod;
}
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 ‘void init(int)’: answer.code:9:9: error: ‘assert’ was not declared in this scope 9 | assert(p == mod); | ^~~~~~ answer.code:2:1: note: ‘assert’ is defined in header ‘<cassert>’; did you forget to ‘#include <cassert>’? 1 | #include "inv.h" +++ |+#include <cassert> 2 |