# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1032900 | Zicrus | Carnival Tickets (IOI20_tickets) | 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.
#include <bits/stdc++.h>
#include "tickets.h"
using namespace std;
typedef long long ll;
ll find_maximum(int k, vector<vector<int>> x) {
vector<int> s(x.size());
for (int i = 0; i < x.size(); i++) s[i] = x[i][0];
sort(s.begin(), s.end());
ll median = s[s.size() / 2];
ll sum = 0;
for (auto &e : s) sum += abs(e - median);
allocate_tickets(vector<vector<int>>(n, vector<int>(1)));
return sum;
}