# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305439 | Jarif_Rahman | Carnival Tickets (IOI20_tickets) | C++17 | 2 ms | 768 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>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
vector<vector<int>> r;
long long find_maximum(int k, vector<vector<int>>rrrr){
r = rrrr;
int n = r.size(), m = r[0].size();
vector <ll> v;
for(int i = 0; i < n; i++) v.pb(r[i][0]);
sort(v.begin(), v.end());
ll b = (v[n/2] + v[n/2 - 1])/2;
ll s = 0;
for(ll x: v) s+=abs(x - b);
allocate_tickets(vector<vector<int>>(n, vector<int>(1, 0)));
return s;
}
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... |