| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 321169 | blue | 카니발 티켓 (IOI20_tickets) | C++17 | 0 ms | 0 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>
using namespace std;
long long find_maximum(int k, vector< vector<int> > x)
{
int n = x.size();
vector<int> y(n);
for(int i = 0; i < n; i++) y[i] = x[i][0];
sort(y.begin(), y.end());
int b = y[n/2];
long long res = 0;
for(int i = 0; i < n; i++) res += abs(b - y[i]);
vector< vector<int> > s(n);
for(int i = 0; i < n; i++) s[i] = vector<int>(1, 0);
allocate_tickets(s);
return res;
}
