QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#116816 | #149. Peru | abs998244353# | Compile Error | / | / | C++17 | 445b | 2023-06-30 08:49:28 | 2024-05-31 18:30:10 |
Judging History
你现在查看的是测评时间为 2024-05-31 18:30:10 的历史记录
- [2024-05-31 18:30:10]
- 评测
- 测评结果: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:49:28]
- 提交
answer
#include "peru.h"
#include <cstdio>
typedef long long ll;
const ll INF=0x3f3f3f3f3f3f3f3f;
const int N=2500003;
const int P=1000000007;
int s[N];
ll f[N];
int solve(int n,int k,int* _s){
for(int i=1;i<=n;++i) s[i]=_s[i-1];
int res=0;
for(int i=1;i<=n;++i){
ll mx=s[i];
f[i]=INF;
for(int j=i-1;j>=i-k;--j){
if(s[j]>mx) mx=s[j];
if(f[j]+mx<f[i]) f[i]=f[j]+mx;
}
res=(res*23ll+f[i])%P;
}
return res;
}
Details
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; | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~