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;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
long long find_maximum(int k, std::vector<std::vector<int>> x)
{
int N = x.size();
int M = x[0].size();
vvi ans(N, vi(M, 0));
allocate_tickets(ans);
vi allValues;
for (int i = 0; i < N; ++i)
for (int j = 0; j < M; ++j)
allValues.push_back(x[i][j]);
sort(all(allValues));
ll value = 0;
for (int i = 0; i < sz(allValues) / 2; ++i)
value += allValues[sz(allValues) - 1 - i] - allValues[i];
return value;
}
# | 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... |