QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#408845 | #149. Peru | iee | Compile Error | / | / | C++17 | 673b | 2024-05-11 09:07:07 | 2024-05-11 09:07:07 |
Judging History
This is a historical verdict posted at 2024-05-11 09:07:07.
- [2024-05-11 09:07:07]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-05-11 09:07:07]
- Submitted
answer
#include "peru.h"
#include <bits/stdc++.h>
using namespace std;
constexpr int N = 2.5e6 + 5, base = 23, mod = 1e9 + 7;
using ll = long long;
int n, k;
int a[N];
ll f[N];
int solve(int _n, int _k, int* _v){
n = _n, k = _k;
for (int i = 1; i <= n; i++) {
a[i] = _v[i - 1];
}
for (int i = 1; i <= n; i++) {
f[i] = 1e18;
int mx = 0;
for (int j = i - 1; j >= max(0, i - k); j--) {
mx = max(mx, a[j + 1]);
f[i] = min(f[i], f[j] + mx);
}
}
int sum = 0;
for (int i = 1; i <= n; i++) {
sum = (1ll * sum * base % mod + f[i]) % mod;
}
return sum;
}
详细
implementer.cpp: In function ‘int main()’: implementer.cpp:34:13: error: ‘fout’ was not declared in this scope; did you mean ‘out’? 34 | fprintf(fout, "%d\n", sol); | ^~~~ | out implementer.cpp: In function ‘char nextch()’: implementer.cpp:15:31: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | if (pos == BUF_SIZE) fread(buf, BUF_SIZE, 1, fin), pos = 0; | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~