# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
300444 | tqbfjotld | Carnival Tickets (IOI20_tickets) | C++14 | 1457 ms | 72204 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 <bits/stdc++.h>
using namespace std;
int numsmall[1505];
long long find_maximum(int k, std::vector<std::vector<int>> X) {
int n = X.size();
int m = X[0].size();
long long ans = 0;
vector<vector<pair<int,int> > > sorted;
for (int x = 0; x<n; x++){
vector<pair<int,int> > stuff;
for (int y = 0; y<m; y++){
stuff.push_back({X[x][y],y});
}
sort(stuff.begin(),stuff.end());
sorted.push_back(stuff);
}
for (int x = 0; x<n; x++){
for (int y = m-k; y<m; y++){
ans += sorted[x][y].first;
}
}
priority_queue<pair<int,int> > pq;
for (int x = 0; x<n; x++){
pq.push({-sorted[x][m-k].first-sorted[x][0].first,x});
}
for (int x = 0; x<k*n/2; x++){
# | 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... |