QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#356438 | #5. 在线 O(1) 逆元 | l3773l | Compile Error | / | / | C++14 | 775b | 2024-03-17 19:26:33 | 2024-03-17 19:26:33 |
Judging History
你现在查看的是测评时间为 2024-03-17 19:26:33 的历史记录
- [2024-11-05 21:57:54]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-03-17 19:26:33]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-03-17 19:26:33]
- 提交
answer
#include <bits/stdc++.h>
using namespace std;
#define For(i,a,b) for (int i = (a), i##__end = (b); i <= i##__end; ++i)
#define Ford(i,a,b) for (int i = (a), i##__end = (b); i >= i##__end; --i)
typedef long long ll;
typedef long double lf;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define fl(s) s.begin(), s.end()
#include "inv.h"
int mod;
const int MAXN = 1e9 + 7;
int inve[MAXN];
int mul(int x, int y) {
return (ll)x * y % mod;
}
void init(int p) {
mod = p;
inve[0] = 0;
inve[1] = 1 % mod;
For (i, 2, p) inve[i] = mod - mul(p / i, inve[p % i]);
}
int inv(int x) {
return inve[x];
}
// int main() {
// init(998244353);
// For (i, 1, mod) cout << inv(i) << endl;
// }
詳細信息
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); | ~~~~~^~~~~~~~~~ /tmp/cczs9PYA.o: in function `mul(int, int)': answer.code:(.text+0xd): relocation truncated to fit: R_X86_64_PC32 against symbol `mod' defined in .bss section in /tmp/cczs9PYA.o /tmp/cczs9PYA.o: in function `init(int)': answer.code:(.text+0x2d): relocation truncated to fit: R_X86_64_PC32 against symbol `mod' defined in .bss section in /tmp/cczs9PYA.o collect2: error: ld returned 1 exit status