QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#116808 | #149. Peru | He_Ren# | Compile Error | / | / | C++17 | 689b | 2023-06-30 08:37:10 | 2024-05-31 18:29:44 |
Judging History
你现在查看的是测评时间为 2024-05-31 18:29:44 的历史记录
- [2024-05-31 18:29:44]
- 评测
- 测评结果: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-06-30 08:37:10]
- 提交
answer
#include<bits/stdc++.h>
#include"peru.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAXN = 2.5e5 + 5;
const int mod = 1e9 + 7;
const ll linf = 0x3f3f3f3f3f3f3f3f;
int a[MAXN];
int solve(int n, int d, int *_a)
{
for(int i=1; i<=n; ++i)
a[i] = _a[i-1];
static ll f[MAXN];
fill(f+1, f+n+1, linf);
f[0] = 0;
for(int i=1; i<=n; ++i)
{
int cur = 0;
for(int j=i; j>=1 && j>=i-d+1; --j)
{
cur = max(cur, a[j]);
f[i] = min(f[i], f[j-1] + cur);
}
}
int ans = 0, curpw = 1;
for(int i=n; i>=1; --i)
{
ans = (ans + (ll)f[i] %mod * curpw) %mod;
curpw = (ll)curpw * 23 %mod;
}
return ans;
}
详细
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; | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~