Submission #302124

#TimeUsernameProblemLanguageResultExecution timeMemory
302124arthurconmyCarnival Tickets (IOI20_tickets)C++14
11 / 100
3 ms768 KiB
#include <bits/stdc++.h> using namespace std; #ifndef ARTHUR_LOCAL #include "tickets.h" #endif using ll = long long; #define len(x) int((x).size()) #ifdef ARTHUR_LOCAL void allocate_tickets(vector<vector<int>> ans) { for(auto a:ans) { for(auto b:a) cout << b << " "; } } #endif ll find_maximum(int k, vector<vector<int>> X) { int n = len(X); int m = len(X[0]); vector<vector<int>> answer; vector<ll> vals; for (int i = 0; i < n; i++) { vector<int> row(m); for(int j = 0; j < m; j++) { row[j]=0; vals.push_back(X[i][j]); } answer.push_back(row); } sort(vals.begin(),vals.end()); ll mid = vals[int(n/2)]; ll ans=0LL; for(auto v:vals) ans += abs(v-mid); allocate_tickets(answer); 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...