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>
#define ll long long
using namespace std;
long long find_maximum(int k, std::vector<std::vector<int>> x) {
ll n = x.size();
ll arr[n];
for(int i=0; i<n; i++){
arr[i] = x[i][0];
}
sort(arr, arr+n);
ll mx = 0;
ll ind;
if(n%2==0){
ind = n/2-1;
} else {
ind = n/2;
}
ll a = arr[ind];
for(int i=0; i<n; i++){
ll temp = abs(arr[i]-a);
mx = mx+temp;
}
vector<vector<int>> answer;
for(int i=0; i<n; i++){
answer.push_back({0});
}
allocate_tickets(answer);
return mx;
}
// long long find_maximum(int k, std::vector<std::vector<int>> x) {
// int n = x.size();
// int m = x[0].size();
// std::vector<std::vector<int>> answer;
// for (int i = 0; i < n; i++) {
// std::vector<int> row(m);
// for (int j = 0; j < m; j++) {
// if (j < k) {
// row[j] = j;
// } else {
// row[j] = -1;
// }
// }
// answer.push_back(row);
// }
// allocate_tickets(answer);
// return 1;
// }
# | 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... |