QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#67391 | #5099. 朝圣道 | Scapegoat_Dawn | Compile Error | / | / | C++14 | 1.2kb | 2022-12-10 12:26:32 | 2022-12-10 12:26:52 |
Judging History
This is the latest submission verdict.
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2022-12-10 12:26:52]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2022-12-10 12:26:32]
- Submitted
answer
#include "pilgrimage.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
inline int read() {
int x = 0;
char c = getchar();
bool f = 0;
while(!isdigit(c)) f |= (c == '-'), c = getchar();
while(isdigit(c)) x = (x * 10) + (c ^ 48), c = getchar();
return f ? -x : x;
}
const int maxn = 3000 + 5;
int mod;
int f[maxn][maxn << 1], Answer[maxn], Inv2, Inv4;
inline int Ksm(int x, int y) {
int res = 1;
while(y) {
if(y & 1) res = 1ll * res * x % mod;
x = 1ll * x * x % mod;
}
return res;
}
inline int Calc(int x) { return Ksm(x, mod - 2); }
inline int ask(ll n) { return Answer[n]; }
inline void init(int o, int p) {
mod = p;
f[0][3000] = 1, Inv2 = Calc(2), Inv4 = Calc(4);
for(register int i = 1; i <= 3000; ++i)
for(register int j = 3000 - i; j <= 3000 + i; ++j)
f[i][j] = (1ll * f[i - 1][j - 1] * Inv4 % mod + 1ll * f[i - 1][j] * Inv2 % mod + 1ll * f[i - 1][j + 1] * Inv4 % mod) % mod;
for(register int i = 1; i <= 3000; ++i) {
for(register int j = 3000 - i; j <= 3000 + i; ++j) Answer[i] = (1ll * Answer[i] + 1ll * f[i][i - j] * abs(j - 3000) % mod) % mod;
}
}
详细
/usr/bin/ld: /tmp/ccMzgtz6.o: in function `main': implementer.cpp:(.text.startup+0x2b): undefined reference to `init(int, int)' /usr/bin/ld: implementer.cpp:(.text.startup+0x16c): undefined reference to `ask(long long)' collect2: error: ld returned 1 exit status