# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
412646 | losmi247 | Boxes with souvenirs (IOI15_boxes) | C++14 | 1 ms | 204 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e3+2;
ll n,k,l;
int pos[N];
ll kje1(){
ll sol = 0;
for(int i = 0; i < n; i++){
ll dod = 2*min(pos[i],(int)l-pos[i]);
sol += dod;
}
return sol;
}
ll kjen(){
ll mini = pos[0],maxi = pos[n-1];
ll sol = min({l,2*maxi,2*(l-mini)});
return sol;
}
ll delivery(int br1,int br2,int br3,int *positions){
n = br1;
k = br2;
l = br3;
for(int i = 0; i < n; i++) pos[i] = positions[i];
if(k == 1) return kje1();
if(k == n) return kjen();
}
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... |