Submission #386030

#TimeUsernameProblemLanguageResultExecution timeMemory
386030AdOjis485Carnival Tickets (IOI20_tickets)C++17
11 / 100
2 ms748 KiB
#include "tickets.h" #include <vector> #include <algorithm> #define int long long using namespace std; int median(vector<int> vec) { sort(vec.begin(), vec.end()); return vec[vec.size() / 2]; } int find_maximum(signed k, vector<vector<signed> > x) { int n = x.size(); int m = x[0].size(); vector<int> vec(n); for(int i = 0; i < n; i ++) vec[i] = x[i][0]; int med = median(vec); int ans = 0; for(int i = 0; i < n; i ++) ans += abs(med - vec[i]); vector<vector<signed> > ansvec(n, vector<signed> (m, 0)); allocate_tickets(ansvec); 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...