# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
516227 | MohamedAliSaidane | Boxes with souvenirs (IOI15_boxes) | C++14 | 0 ms | 0 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;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
#define pb push_back
#define popb pop_back
#define all(v) (v).begin(),(v).end()
#define ff first
#define ss second
const ll INF= 1e18 ;
const ll MOD = 1e9 + 7;
int n, k, l;
vi A;
int delivery(int N, int K, int L, vi positions)
{
n = N, k = K, l = L;
A = positions;
ll ans = 0ll;
ll maxt = 0ll;
for(auto e: positions)
{
ans += min(e,l-e);
}
return 2*ans;
}
/*
int main()
{
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int N, K, L;
vi positions;
cin >> N >> K >> L;
for(int i = 0; i <N; i ++)
{
int x; cin >> x;
positions.pb(x);
}
cout << delivery(N,K,L,positions);
}*/