# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
532796 | aryan12 | Carnival Tickets (IOI20_tickets) | C++17 | 2 ms | 716 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 <vector>
#include <bits/stdc++.h>
using namespace std;
long long find_maximum(int k, std::vector<std::vector<int> > x) {
long long K = k;
vector<vector<long long> > input;
for(long long i = 0; i < x.size(); i++) {
vector<long long> row;
for(long long j = 0; j < x[0].size(); j++) {
row.push_back(x[i][j]);
}
input.push_back(row);
}
long long n = x.size();
long long m = x[0].size();
vector<vector<int> > answer(n, vector<int> (m, -1));
vector<long long> kekw;
for(long long i = 0; i < n; i++) {
for(long long j = 0; j < m; j++) {
answer[i][j] = 0;
kekw.push_back(input[i][j]);
}
}
sort(kekw.begin(), kekw.end());
long long ans = 0;
long long lmao = kekw[n / 2];
for(long long i = 0; i < n; i++) {
ans += abs(lmao - kekw[i]);
}
allocate_tickets(answer);
return ans;
}
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... |