Submission #827124

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