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 <vector>
#include <algorithm>
long long find_maximum(int k, std::vector<std::vector<int>> x) {
int n = x.size();
int m = x[0].size();
std::vector<std::vector<int>> answer;
std::vector<int> tickets;
for (int i = 0; i < n; i++) {
std::vector<int> row(m);
tickets.push_back(x[i][0]);
for (int j = 0; j < m; j++) {
row[j] = 0;
}
answer.push_back(row);
}
std::sort(tickets.begin(), tickets.end());
long long res = 0;
for (int i = 0; i < n / 2; i++) {
res += (tickets[n - i - 1] - tickets[i]);
}
allocate_tickets(answer);
return res;
}
# | 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... |