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;
void allocate_tickets( std::vector<std::vector<int>> _d);
long long find_maximum(int k, vector<vector<int>>x) {
const int n = (int)x.size();
vector<long long>v(x.size());
vector<vector<int>>ret(1, vector<int>(n));
for(int i = 0 ; i < n ; i++)
v[i] = x[i][0], ret[0][i] = v[i];
allocate_tickets(x);
long long mn = LLONG_MAX;
for(int i = 0 ; i < n ; i++) {
long long curr = 0;
long long Z = v[i];
for(int j = 0 ; j < n ; j++)
curr += abs(Z - v[j]);
mn = min(mn, curr);
}
return mn;
}
# | 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... |