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 endl '\n'
#define pii pair <int, int>
#define pb push_back
#define F first
#define S second
#define ll long long
#define io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define M_PI 3.14159265358979323846
const int N = 200005;
const int mod = 1e9 + 7;
long long delivery(int n, int k, int l, int p[]) {
if(k == 1){
ll ans = 0;
for(int i = 0; i < n; i++){
ans += min(p[i], l - p[i]);
}
return ans * 2;
}
if(k == n){
ll ans = l;
for(int i = 1; i < n; i++){
ll cur = (p[i - 1] + (l - p[i]));
ans = min(ans, cur);
}
return ans * 2;
}
return 0;
}
# | 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... |