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 <vector>
#include <algorithm>
#define int long long
using namespace std;
int median(vector<int> vec)
{
sort(vec.begin(), vec.end());
return vec[vec.size() / 2];
}
int find_maximum(signed k, vector<vector<signed> > x)
{
int n = x.size();
int m = x[0].size();
vector<int> vec(n);
for(int i = 0; i < n; i ++) vec[i] = x[i][0];
int med = median(vec);
int ans = 0;
for(int i = 0; i < n; i ++) ans += abs(med - vec[i]);
vector<vector<signed> > ansvec(n, vector<signed> (m, 0));
allocate_tickets(ansvec);
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... |