Submission #704038

#TimeUsernameProblemLanguageResultExecution timeMemory
704038bebraCarnival Tickets (IOI20_tickets)C++17
11 / 100
1 ms724 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; using ll = long long; ll find_maximum(int k, vector<vector<int>> x) { int n = x.size(); int m = x[0].size(); vector<vector<int>> s(n, vector<int>(m, -1)); vector<int> a; for (int i = 0; i < n; ++i) { s[i][0] = 0; a.push_back(x[i][0]); } allocate_tickets(s); ll ans = 0; nth_element(a.begin(), a.begin() + n / 2, a.end()); for (auto x : a) { ans += abs(x - a[n / 2]); } 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...