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>
#define pb push_back
#define all(x) begin(x),end(x)
#define SZ(x) (int)(x).size()
#define mem(x) memset(&x,y,sizeof(x))
#define ll long long
using namespace std;
ll find_maximum(int k, vector<vector<int>> x) {
int n=SZ(x),m=SZ(x[0]);
vector<vector<int>> answer(n,vector<int>(m,-1));
ll s=0;
if(k==1) {
vector<array<int,2>> vec;
for(int i=0; i<n; i++) {
s+=x[i][m-1];vec.pb({-x[i][0]-x[i][m-1],i});
answer[i][m-1]=0;
}
sort(all(vec));reverse(all(vec));
for(int i=0; i<n/2; i++) {
s+=vec[i][0];
answer[vec[i][1]][m-1]=-1;
answer[vec[i][1]][0]=0;
}
}
allocate_tickets(answer);
return s;
}
# | 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... |