QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#67387 | #5099. 朝圣道 | Scapegoat_Dawn | Compile Error | / | / | C++14 | 1.1kb | 2022-12-10 12:25:11 | 2022-12-10 12:25:21 |
Judging History
你现在查看的是最新测评结果
- [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:25:21]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2022-12-10 12:25:11]
- 提交
answer
#include "pilgrimage.h"
#include<bits/stdc++.h>
#define int 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 = res * x % mod;
x = x * x % mod;
}
return res;
}
inline int Calc(int x) { return Ksm(x, mod - 2); }
inline int ask(int 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] = (f[i - 1][j - 1] * Inv4 % mod + f[i - 1][j] * Inv2 % mod + 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] = (Answer[i] + f[i][i - j] * abs(j - 3000) % mod) % mod;
}
}
详细
answer.code:25:12: error: ambiguating new declaration of ‘long long int ask(long long int)’ 25 | inline int ask(int n) { return Answer[n]; } | ^~~ In file included from answer.code:1: pilgrimage.h:3:5: note: old declaration ‘int ask(long long int)’ 3 | int ask (long long n); | ^~~