# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
706713 | dungnguyenn_05 | Boxes with souvenirs (IOI15_boxes) | C++17 | 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.
// Written By DungNguyen
#include<bits/stdc++.h>
#define fs first
#define sc second
#define pb push_back
#define all(x) x.begin(),x.end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef tuple<int,int,int> tp;
const int N=10000005;
int n,k,l,a[N];
void sub1()
{
ll res=0;
for(int i=1;i<=n;i++)
res+=min(a[i],n+1-a[i]);
cout<<res;
}
void solve()
{
cin>>n>>k>>l;
for(int i=1;i<=n;i++)
cin>>a[i];
if(k==1)
sub1();
}
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int test=1;
// cin>>test;
while(test--)
solve();
}