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;
#define vi vector<int>
#define lli long long int
#define rep(i, a, b) for(int i = (a); i <= (b); i++)
#define debugsl(x) cout << #x << " = " << x << ", "
#define debug(x) debugsl(x) << endl
lli suma;
int mediana;
vi todos;
vector<vector<int> > respuesta;
long long find_maximum(int k, vector<vector<int> > x) {
int n = x.size();
int m = x[0].size();
rep(i, 0, n - 1){
rep(j, 0, m - 1)
todos.push_back(x[i][j]);
}
sort(todos.begin(), todos.end());
mediana = todos[(n * m) >> 1];
rep(i, 0, n - 1){
vector<int> bolsa(m);
rep(j, 0, m - 1){
if (j < k) bolsa[j];
else bolsa[j] = -1;
}
suma += abs(mediana - x[i][0]);
respuesta.push_back(bolsa);
}
allocate_tickets(respuesta);
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... |