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;
const int MAXN = 1512;
int resp[MAXN];
long long find_maximum(int k, vector<vector<int>> x) {
int n = x.size();
int m = x[0].size();
vector <int> d1;
for(int i = 0; i < n; i++) {
d1.push_back(x[i][0]);
}
sort(d1.begin(), d1.end());
long long md = d1[m/2];
long long resp = 0;
for(int i = 0; i < n; i++) {
if(d1[i] < md) resp += md - d1[i];
else resp += d1[i] - md;
}
vector <vector <int> > answer;
vector <int> temp;
for(int i = 0; i < n; i++) {
temp.push_back(0);
answer.push_back(temp);
temp.clear();
}
//answer.push_back(temp);
allocate_tickets(answer);
return resp;
}
# | 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... |