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;
long long find_maximum(int k, std::vector<std::vector<int>> x) {
int n = x.size();
vector<std::vector<int>> answer(n,vector<int>(1,1));
long long price = 0;
vector<int> prices;
for(int i = 0;i<n;i++){
prices.push_back(x[i][0]);
}
sort(prices.begin(),prices.end());
int mid = (prices[n/2]+prices[n/2-1])/2;
for(int i = 0;i<n;i++){
price += abs(x[i][0] - mid);
}
allocate_tickets(answer);
return price;
}
# | 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... |