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<bits/stdc++.h>
using namespace std;
long long find_maximum(int k, std::vector<std::vector<int>> x) {
int n = x.size();
int m = x[0].size();
long long prize=0;
std::vector<std::vector<int>> answer(n, std::vector<int>(m));
vector<long long>v;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
v.push_back(x[i][j]);
answer[i][j]=0;
}
}
allocate_tickets(answer);
sort(v.begin(),v.end());
long long av=v[n/2]+v[n/2 -1];
av/=2;
for(int i:v){
prize+=abs(i-av);
}
return prize;
}
# | 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... |