# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
300757 | IgorI | 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;
#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(x) (x).begin(), (x).end()
long long find_maximim(int k, std::vector<std::vector<int> > x)
{
int n = x.size(), m = x[0].size();
vector<long long> s;
for (int i = 0; i < n; i++) s.push_back(x[i][0]);
sort(all(s));
long long si = 0;
for (int i = 0; i < n / 2; i++) si += s[i + n / 2] - s[i];
allocate_tickets(vector<vector<int> >(n, vector<int>(m)));
return si;
}