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>
using namespace std;
long long find_maximum(int k, vector<vector<int>> x) {
    int length = x.size();
    vector<vector<int>> s {};
    for (int i = 0; i < length; i++) s.push_back({0});
    allocate_tickets(s);
    vector<int> values {};
    for (auto el : x) values.push_back(el[0]);
    sort(values.begin(), values.end());
    int optimal_value = values[length/2];
    
    long long result = 0ll;
    for (auto el : x) {
        result += static_cast<long long>(abs(optimal_value-el[0]));
    }
    return result;
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |