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;
long long find_maximum(int k, vector<vector<int>> x) {
long long n = x.size();
long long m = x[0].size();
vector<vector<int>> answer (n, vector <int> (m));
long long sum = 0;
for (int i = 0; i < n; i++){
sum+=x[i][0];
}
long long rs1 = 0, rs2 = 0, rs3 = 0;
for (int i = 0; i < n; i++){
rs1+=abs(1LL * x[i][0] - (sum / n));
rs2+=abs(1LL * x[i][0] - ((sum / n) + 1));
rs2+=abs(1LL * x[i][0] - ((sum / n) - 1));
}
allocate_tickets(answer);
return min({rs1, rs2, rs3});
}
# | 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... |