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>
using namespace std;
long long solvem1(int n, int k, vector<vector<int> >& x){
vector<int> s(n);
for(int i=0; i<n; i++){
s[i]=x[i][0];
}
sort(s.begin(), s.end());
int mi=s[n/2];
long long ans=0;
for(int i=0; i<n; i++){
if(s[i]<mi){
ans += mi-s[i];
}
else{
ans += s[i]-mi;
}
}
return ans;
}
long long find_maximum(int k, std::vector<std::vector<int>> x) {
int n = x.size();
int m = x[0].size();
vector<vector<int> > answer(n, vector<int> (m, 1));
allocate_tickets(answer);
long long ans=solvem1(n, k, x);
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... |