# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
603776 | CyberCow | Carnival Tickets (IOI20_tickets) | C++17 | 3 ms | 596 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 <cmath>
using namespace std;
using ll = long long;
ll n;
ll qaq(vector<ll> qaqa)
{
ll polni = 1000000000000000000LL;
for (int i = 0; i < qaqa.size(); i++)
{
ll chsh = 0;
for (int j = 0; j < qaqa.size(); j++)
{
chsh += abs(qaqa[i] - qaqa[j]);
}
polni = min(polni, chsh);
}
return polni;
}
long long find_maximum(int k, vector<vector<int>> x) {
n = x.size();
vector<ll>zibil;
vector<vector<int>>ans(n, vector<int>(1, 0));
for (int i = 0; i < n; i++) {
zibil.push_back(x[i][0]);
}
allocate_tickets(ans);
return qaq(zibil);
}
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... |