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;
bool cmp(long long int x,long long int y)
{
return x<y;
}
long long find_maximum(int k, std::vector<std::vector<int> > x) {
int mm = x[0].size(); //find the m;
int n = x.size();
vector< vector <int> > s;
long long int sum =0;
if(mm==1)
{
for(int i=0;i<n;i++)
{
vector<int> q;
q.push_back(0);
s.push_back(q);
}
long long int a[20005];
for(int i=0;i<n;i++)
{
a[i] = x[i][0];
}
sort(a,a+n);
long long int ans = a[n/2-1]+a[n/2];
ans /=2;
for(int i=0;i<n;i++)
{
sum += abs(ans - a[i]);
}
}
allocate_tickets(s);
return sum;
}
# | 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... |