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>
#define ll long long
#define ff first
#define ss second
#define pb push_back
using namespace std;
int n, m, K;
long long find_maximum(int k, std::vector<std::vector<int>> x) {
n = x.size();
m = x[0].size();
K = k;
std::vector<std::vector<int>> answer;
vector<int>row;
for(int i = 0 ; i < m ; i ++)row.pb(-1);
for(int i = 0 ; i < n ; i ++)answer.pb(row);
ll ans = 0;
for(int r = 0 ; r < k ; r ++){
vector<ll>acum;
for(int i = 0 ; i < n ; i ++){
answer[i][r] = r;
acum.pb(x[i][r]);
}
sort(acum.begin(), acum.end());
for(int i = 0, j = n-1; i < j; i ++, j--){\
ans += acum[j] - acum[i];
}
}
allocate_tickets(answer);
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... |