Submission #372458

#TimeUsernameProblemLanguageResultExecution timeMemory
372458Jarif_RahmanCarnival Tickets (IOI20_tickets)C++17
11 / 100
2 ms748 KiB
#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;
long long find_maximum(int k, vector<vector<int>> v){
    int n = v.size(), m = v[0].size();
    ll ans = 0;
    vector<ll> sth;
    for(int i = 0; i < n; i++){
        sth.pb(v[i][0]);
    }
    sort(sth.begin(), sth.end());
    ll md = sth[n/2];
    for(int i = 0; i < n; i++) ans+=abs(sth[i]-md);
    vector<vector<int>> all(n, vector<int>(m));
    for(int i = 0; i < n; i++) all[i][0] = 0;
    allocate_tickets(all);
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...