# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1091029 | hengliao | Boxes with souvenirs (IOI15_boxes) | C++14 | 413 ms | 137364 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>
#include <random>
#include <chrono>
using namespace std;
#define F first
#define S second
#define pb push_back
#define vll vector<ll>
#define pll pair<ll, ll>
typedef long long ll;
const ll inf=1e18;
ll delivery(int n, int k, int l, int p[]) {
auto get=[&](ll a, ll b){
if(b<a) return 0LL;
ll re=l;
re=min(re, 2LL*p[b]);
re=min(re, 2LL*(l-p[a]));
return re;
};
ll ans=inf;
for(ll s=0;s<k;s++){
ll cur=get(0, s-1);
ll pre;
for(ll i=s;i<n;i+=k){
cur+=get(i, min(i+k-1, (ll)n-1));
}
ans=min(ans, cur);
}
return ans;
}
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... |