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;
using ll = long long;
ll find_maximum(int k, vector<vector<int>> x) {
int n = x.size(), m = x[0].size();
vector<vector<int>> g(n, vector<int> (m, -1));
ll res {};
if(k < 2) {
array<ll, 2> a[n] {};
for(int i = n; i--; ) {
res -= x[i][0];
a[i] = {x[i][0] + x[i][m-1], i};
}
sort(a, a + n);
for(int i = n/2; i < n; ++i)
g[a[i][1]][m-1] = 0, res += a[i][0];
for(int i = n/2; i--; )
g[a[i][1]][0] = 0;
} else {
assert(0);
}
allocate_tickets(g);
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... |