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>
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#include"boxes.h"
using namespace std ;
long long delivery( int n , int k , int l , int pos[])
{
if(k==1){
vector<long long > arr(n);
for(int i=0;i<n;i++)
{
arr[i]=MIN(-pos[i]+l , pos[i] );
}
long long c=0;
while (*min_element(arr.begin(),arr.end())!= (long long)1e18)
{
//cout<<*min_element(pos.begin(),pos.end())<<endl;
c+=*min_element(arr.begin(),arr.end())*2;
*min_element(arr.begin(),arr.end())=(long long )1e18;
}
return c;
}
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... |