This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#define ll long long
#include "tickets.h"
#include <bits/stdc++.h>
using namespace std;
long long find_maximum(int k, vector<vector<int>> x)
{
ll n = x.size();
ll m = x[0].size();
if(m == 1)
{
vector<vector<int>> output(n, vector<int> (1, 1));
allocate_tickets(output);
sort(x[0].begin(), x[0].end());
ll ans = 0;
ll add = 0;
for(ll i = n/2; i >= 0; i--)
{
add += x[0][n/2] - x[0][i];
ans += add;
}
add = 0;
for(ll i = n/2+1; i < n; i++)
{
add += x[0][i] - x[0][n/2];
ans += add;
}
return ans;
}
return 0;
}
# | 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... |