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 <algorithm>
#include <vector>
using namespace std;
long long find_maximum(int k, vector<vector<int> > x)
{
int n = x.size();
int m = x[0].size();
long long ans = 0;
vector<int> sum;
for (int i = 0; i < n; i++){
for (int j = 0; j < k; j++){
ans -= x[i][j];
sum.push_back(x[i][j] + x[i][m - k + j]);
}
}
sort(sum.rbegin(), sum.rend());
int pop = n * k / 2;
for (int i = 0; i < pop; i++) ans += sum[i];
return ans;
}
# | 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... |