# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
68401 | zetapi | Boxes with souvenirs (IOI15_boxes) | C++14 | 3 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "boxes.h"
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define itr ::iterator
const int MAX=1e5;
ll N,K,L,sz,start[MAX],finish[MAX];
long long delivery(int N_,int K_, int L_,int P[])
{
N=N_;
K=K_;
L=L_;
for(int A=0;A<N;A+=K)
{
start[A/K]=P[A];
finish[A/K]=P[min(A+K-1,N-1)];
sz++;
}
int res=0;
for(int A=0;A<sz;A++)
{
//cout<<start[A]<<" "<<finish[A]<<"\n";
res+=min(2*finish[A],min(2*(L-start[A]),L));
}
return res;
}
/*int main()
{
ios_base::sync_with_stdio(false);
int P[]={1,2,5};
cout<<delivery(3,2,8,P)<<"\n";
return 0;
}*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |