QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#101596 | #5. 在线 O(1) 逆元 | NOI_AK_ME | Compile Error | / | / | C++20 | 817b | 2023-04-30 13:56:17 | 2024-11-05 21:48:58 |
Judging History
你现在查看的是最新测评结果
- [2024-11-05 21:48:58]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2023-04-30 13:56:21]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-04-30 13:56:17]
- 提交
answer
#pragma once
#pragma GCC optimize("Ofast, unroll-loops")
#include "inv.h"
int djq[3035136], arr[974849];
int inv(int x) {
const int p = (unsigned long long) x * arr[x >> 10] % 998244353;
return (unsigned long long) arr[x >> 10] * (p < 3035136 ? djq[p] : 998244353 - djq[998244353 - p]) % 998244353;
}
int getinv(int x) {
return x == 1 ? 1 : 974849 - (unsigned long long)(974849 / x) * getinv(974849 % x) % 974849;
}
void init() {
for(int i = 987;i;--i) {
int inv = getinv(i);
for(int j = 1;j <= 987;++j) {
arr[(unsigned long long) j * inv % 974849] = i;
arr[974849 - (unsigned long long) j * inv % 974849] = 998244353 - i;
}
}
arr[0] = djq[1] = 1;
for(int i = 2;i < 3035136;++i)
djq[i] = 998244353 - (unsigned long long)(998244353 / i) * djq[998244353 % i] % 998244353;
}
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:1:9: warning: #pragma once in main file 1 | #pragma once | ^~~~ answer.code:2:43: warning: bad option ‘-f unroll-loops’ to pragma ‘optimize’ [-Wpragmas] 2 | #pragma GCC optimize("Ofast, unroll-loops") | ^ In file included from answer.code:3: inv.h:1:16: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes] 1 | void init(int p); | ^ inv.h:1:16: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes] inv.h:2:14: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes] 2 | int inv(int n); | ^ inv.h:2:14: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes] answer.code:5:14: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes] 5 | int inv(int x) { | ^ answer.code:9:17: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes] 9 | int getinv(int x) { | ^ answer.code:12:11: warning: bad option ‘-f unroll-loops’ to attribute ‘optimize’ [-Wattributes] 12 | void init() { | ^ /usr/bin/ld: /tmp/ccDYezAU.o: in function `main': implementer.cpp:(.text.startup+0x12b): undefined reference to `init(int)' collect2: error: ld returned 1 exit status