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;
long long find_maximum(int k, vector<vector<int>> x) {
int n = x.size();
int m = x[0].size();
vector<vector<int>> ans(n, vector<int>(m, -1));
long long a = 0;
vector<pair<int64_t, int>> b(n);
for(int i = 0; i < n; i++){
ans[i][m-1] = 0;
b[i] = {1LL*(x[i][0] + x[i][m-1]), i};
a += 1LL*x[i][m-1];
}
sort(b.begin(), b.end());
for(int i = 0; i < n/2; i++){
a -= b[i].first;
ans[b[i].second][0] = 0;
ans[b[i].second][m-1] = -1;
}
allocate_tickets(ans);
return a;
}
# | 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... |