Submission #577303

#TimeUsernameProblemLanguageResultExecution timeMemory
577303VanillaCarnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; long long find_maximum(int k, vector<vector<int>> x) { long long n = x.size(); long long m = x[0].size(); vector<vector<int>> answer (n, vector <int> (m)); long long sum = 0; for (int i = 0; i < n; i++){ sum+=x[i][0]; } long long rs1 = 0, rs2 = 0, rs3 = 0; for (int i = 0; i < n; i++){ rs1+=abs(1LL * x[i][0] - (sum / n)); rs2+=abs(1LL * x[i][0] - ((sum / n) + 1)); rs2+=abs(1LL * x[i][0] - ((sum / n) - 1)); } allocate_tickets(answer); return min({rs1, rs2, rs3}); }
#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...