Submission #638697

#TimeUsernameProblemLanguageResultExecution timeMemory
638697slimeCarnival Tickets (IOI20_tickets)C++14
11 / 100
1 ms724 KiB
#include "tickets.h" #include "bits/stdc++.h" using namespace std; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); int m = x[0].size(); std::vector<std::vector<int>> answer; for (int i = 0; i < n; i++) { std::vector<int> row(m); for (int j = 0; j < m; j++) { if (j < k) { row[j] = j; } else { row[j] = -1; } } answer.push_back(row); } allocate_tickets(answer); vector<int> ff; for(int i=0; i<n; i++) ff.push_back(x[i][0]); sort(ff.begin(), ff.end()); long long ss = 0; for(int x: ff) ss += abs(x - ff[n / 2]); return ss; }
#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...