# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
331625 | pggp | Carnival Tickets (IOI20_tickets) | C++14 | 2 ms | 748 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 <bits/stdc++.h>
#include "tickets.h"
using namespace std;
void allocate_tickets(vector < vector < int > > s);
long long find_maximum(int k, vector < vector < int > > x){
vector < vector < int > > to_allocate;
vector < int > v;
for(vector < int > t : x){
vector < int > a;
to_allocate.push_back(a);
for(int i : t){
to_allocate[to_allocate.size() - 1].push_back(0);
v.push_back(i);
}
}
allocate_tickets(to_allocate);
sort(v.begin(), v.end());
long long ans = 0;
for (int i = 0; i < v.size(); ++i)
{
if(i < v.size() / 2){
ans -= v[i];
}
else{
ans += v[i];
}
}
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... |