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;
typedef long long ll;
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;
ll me=0;
for (int i = 0; i < n; i++) {
std::vector<int> row(m);
row[0] = x[i][0];
m+=x[i][0];
answer.push_back(row);
}
me/=n;
ll bs=10000000000000;
for(int i=me-2; i<me+2; i++)
{
ll st=0;
for (int j = 0; j < n; j++) {
if (j < k) {
st=abs(x[j][0]-i);
}
}
bs=min(bs,st);
}
allocate_tickets(answer);
return bs;
}
# | 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... |