#include "tickets.h"
#include "bits/stdc++.h"
using namespace std;
long long find_maximum(int k, vector<vector<int>> x) {
int n = x.size();
int m = x[0].size();
vector<vector<int>> answer(n,vector<int>(m,-1));
long long tot = 0;
for(int i=0;i<n;i++) tot-=x[i][0];
vector<array<long long,2>> v;
for(int i=0;i<n;i++) v.push_back({x[i].back()+x[i][0],i});
sort(v.begin(),v.end());
reverse(v.begin(),v.end());
for(int i=0;i<n/2;i++){
tot += v[i][0];
answer[v[i][1]][m-1]=0;
}
for(int i=n/2;i<n;i++){
answer[v[i][1]][0]=0;
}
allocate_tickets(answer);
return tot;
}
# | 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... |