QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#149610 | #2785. Boxes with souvenirs | AbdelmagedNour# | Compile Error | / | / | C++20 | 577b | 2023-08-24 22:53:02 | 2023-08-24 22:53:06 |
Judging History
你现在查看的是测评时间为 2023-08-24 22:53:06 的历史记录
- [2023-08-24 22:53:06]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-08-24 22:53:02]
- 提交
answer
#include <bits/stdc++.h>
using namespace std;
//#include "grader.cpp"
#include "boxes.h"
long long delivery(int N, int K, int L, int p[]){
vector<long long>pre(N+1),suf(N+1);
long long res=LLONG_MAX;
for(int i=0;i<N;i++)pre[i+1]=2*p[i]+(i+1>=K?pre[i+1-K]:0);
for(int i=N-1;i>=0;i--)suf[i]+=2*(L-p[i])+(i+K<N?suf[i+K]:0);
for(int i=0;i<N;i++)res=min(res,pre[i]+suf[i]);
for(int i=K-1;i<N;i++){
int l=p[i-K+1],r=p[i];
int cost=min({L,2*r,2*(L-l)});
res=min(res,cost+pre[i-K+1]+suf[i+1]);
}
return res;
}
Details
cc1plus: fatal error: implementer.cpp: No such file or directory compilation terminated.