# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
301031 | Nucleist | Carnival Tickets (IOI20_tickets) | 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 "tickets.h"
#include <bits/stdc++.h>
#define size(x) x.size()
#define ve vector<int>
#define pb push_back
using namespace std;
long long find_maximum(int k,vector<vector<int>> x) {
int m=sz(x);
ve cur;
for (int i = 0; i < m; ++i)
{
cur.pb(x[i][0]);
}
sort(all(cur));
int in=x[m/2];
int ans=0;
for(auto it:cur){
ans+=abs(it-in);
}
return ans;
}