# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1082445 | wood | Carnival Tickets (IOI20_tickets) | C++17 | 501 ms | 73108 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;
#define vi vector<int>
#define ll long long
#define pb push_back
#define eb emplace_back
#define p32 pair<int,int>
long long find_maximum(int k, std::vector<std::vector<int>> x) {
int n = x.size(), m = x[0].size();
vector<vi> ans;
if(m==1){
vi p;
for(int i = 0; i<n; i++){ ans.pb({0}); p.pb(x[i][0]);}
sort(p.begin(),p.end());
ll sum = 0;
for(int i =0; i<n; i++) sum+=abs(p[n/2]-p[i]);
allocate_tickets(ans);
return sum;
}
ll result = 0;
bool finalchoice[n];
for(int i = 0; i<2*n; i++){
bool choice[n]; memset(choice,0,sizeof choice); //true if we pick the big card
int mid = x[i%n][0];
if(i>=n){ mid = x[i%n][m-1]; choice[i%n] = true;}
int lowcnt = 0,highcnt = 0;
ll sum = 0;
# | 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... |