# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433667 | SAAD | Carnival Tickets (IOI20_tickets) | C++17 | 1 ms | 204 KiB |
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 <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include "tickets.h"
using namespace std;
long long find_maximum(int k, vector<vector<int>> x) {
vector<vector<int>> x1(x.size()) ;
long long sum = 0 , s = 0 ;
for (int i = 0; i < x.size(); i++) {
sum += x[i][0];
x1[i].push_back(0);
}
sum /= x.size();
long long mx = 1e9 ;
for (int j = max(sum-2, 0LL); j < max(sum-2, 0LL) + 3; j++) {
s = 0;
for (int i = 0; i < x.size(); i++) {
s += abs(x[i][0] - sum);
}
mx = min(s,mx);
}
allocate_tickets(x1);
return mx;
}
Compilation message (stderr)
# | 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... |