# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
660090 | aryan12 | Carnival Tickets (IOI20_tickets) | C++17 | 1 ms | 724 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 <vector>
#include <bits/stdc++.h>
using namespace std;
long long find_maximum(int k, vector<vector<int> > x)
{
long long n = x.size(), m = x[0].size();
vector<vector<int> > ans(n, vector<int> (m, 0));
if(k == 1)
{
vector<long long> res;
for(long long i = 0; i < x.size(); i++)
{
res.push_back(x[i][0]);
}
sort(res.begin(), res.end());
long long idx = n / 2;
long long final_ans = 0;
for(long long i = 0; i < n; i++)
{
final_ans += abs(res[idx] - res[i]);
}
allocate_tickets(ans);
return final_ans;
}
return -1;
}
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... |