# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
622476 | happypotato | Carnival Tickets (IOI20_tickets) | C++17 | 2 ms | 724 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;
#define ll long long
#define pii pair<int, int>
#define ff first
#define ss second
#define pb push_back
//
const ll MAX = 1e18;
vector<vector<int>> a;
int n, m, k;
ll st1() {
vector<vector<int>> allo;
allo.resize(n, {0});
allocate_tickets(allo);
vector<ll> shit(n);
for (int i = 0; i < n; i++) shit[i] = a[i][0];
sort(shit.begin(), shit.end());
ll ans = 0, cur = shit[n / 2];
for (int i = 0; i < n; i++) {
ans += abs(shit[i] - cur);
}
return ans;
}
long long find_maximum(int K, vector<vector<int>> x) {
n = x.size(); m = x[0].size(); k = K; a = x;
if (m == 1) return st1();
}
Compilation message (stderr)
# | 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... |