# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
705179 | bin9638 | Boxes with souvenirs (IOI15_boxes) | C++17 | 1 ms | 340 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;
#define ll long long
#define fs first
#define sc second
#define N 1010
#define pb push_back
ll dp[1010][1010];
ll delivery(int n,int k,int l,int a[])
{
sort(a,a+n);
ll res=0;
for(int i=0;i<n;i++)
res+=1ll*min(a[i],l-a[i])*2;
return res;
}
#ifdef SKY
int main()
{
freopen("A.inp","r",stdin);
freopen("A.out","w",stdout);
// ios::sync_with_stdio(0);
// cin.tie(NULL);
// cout.tie(NULL);
int n,k,l;
cin>>n>>k>>l;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
cout<<delivery(n,k,l,a);
return 0;
}
#endif // SKY
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... |