# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
395530 | snasibov05 | Carnival Tickets (IOI20_tickets) | C++14 | 649 ms | 53400 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>
#include <vector>
using namespace std;
long long find_maximum(int k, vector<std::vector<int>> x) {
int n = x.size();
int m = x[0].size();
vector<vector<int>> ans(n, vector<int>(m, -1));
vector<int> mx(n) , mn(n);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
if (x[i][mx[i]] < x[i][j]) mx[i] = j;
if (x[i][mn[i]] > x[i][j]) mn[i] = j;
}
}
long long res = 0;
for (int i = 0; i < n; ++i) {
res += 1ll*x[i][mx[i]];
ans[i][mx[i]] = 0;
}
vector<pair<int, int>> dif(n);
for (int i = 0; i < n; ++i) {
dif[i] = {x[i][mx[i]] + x[i][mn[i]], i};
}
sort(dif.begin(), dif.end());
# | 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... |