Submission #304519

#TimeUsernameProblemLanguageResultExecution timeMemory
304519SorahISACarnival Tickets (IOI20_tickets)C++17
11 / 100
2 ms768 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; template<typename T> using Prior = priority_queue<T>; template<typename T> using prior = priority_queue<T, vector<T>, greater<T>>; #define X first #define Y second #define ALL(x) (x).begin(), (x).end() #define eb emplace_back #define pb push_back long long find_maximum(int k, vector<vector<int>> v) { int n = v.size(), m = v[0].size(); int64_t sum = 0; vector<vector<int>> ans(n, vector<int>(m, -1)); vector<int> cnt; for (int i = 0; i < n; i++) { for (int j = 0; j < k; j++) { ans[i][j] = j; cnt.eb(v[i][j]); } } sort(ALL(cnt)); for (auto x : cnt) sum += abs(x - cnt[n/2]); allocate_tickets(ans); return sum; }
#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...