# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
384750 | nicholask | Carnival Tickets (IOI20_tickets) | C++14 | 3 ms | 748 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 ll long long
using namespace std;
long long find_maximum(int k,vector <vector <int> > x){
ll n=x.size(),m=x[0].size();
vector <vector <int> > ans(n,vector <int>(m,-1));
if (m==1){
vector <ll> v;
for (ll i=0; i<n; i++) v.pb(x[i][0]);
sort(v.begin(),v.end());
ll opt=v[v.size()/2];
ll sum=0;
for (ll i=0; i<n; i++) sum+=abs(opt-v[i]);
for (ll i=0; i<n; i++) ans[i][0]=0;
allocate_tickets(ans);
return sum;
}
}
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... |