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;
#define lli long long int
#define rep(i,a,b) for (lli i = (a); i <= (b); i++)
#define repa(i,a,b) for (lli i = (a); i >= (b); i--)
#define debug(a) cout << #a << " = " << a << endl;
#define debugsl(a) cout << #a << " = " << a << ", ";
lli n,m,mitad,val;
vector< vector<int> > res;
vector<int>orden;
long long find_maximum(int k, std::vector<std::vector<int>> x) {
n = x.size();
m = x[0].size();
rep(i,0,n-1) orden.push_back(x[i][0]);
sort(orden.begin(), orden.end());
mitad = n/2;
val = orden[mitad-1];
lli suma = 0;
rep(i,0,n-1) suma += abs(x[i][0] - val);
res = vector<vector<int> > (n, vector<int> (m, 0));
allocate_tickets(res);
return suma;
}
# | 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... |