# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
306906 | NicolaAbusaad2014 | Carnival Tickets (IOI20_tickets) | C++14 | 2 ms | 768 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 "tickets.h"
#include <bits/stdc++.h>
using namespace std;
long long find_maximum(int k, std::vector<std::vector<int> > x) {
int n = x.size();
int m = x[0].size();
long long ans,median;
vector<vector<int> > answer;
vector<int>z;
answer.resize(n);
for(long i=0;i<n;i++){
z.push_back(x[i][0]);
answer[i].push_back(0);
}
sort(z.begin(),z.end());
ans=0;
median=z[n/2];
allocate_tickets(answer);
for(long i=0;i<n;i++){
ans+=abs(z[i]-median);
}
return ans;
}
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... |