Submission #616019

#TimeUsernameProblemLanguageResultExecution timeMemory
616019yanndevCarnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms304 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(); if (m == 1) { vector<vector<int>> answer; vector<int> vals {}; int score = 0; for (int i = 0; i < n; i++) { vector<int> row (m); for (int j = 0; j < m; j++) { vals.push_back(x[i][j]); if (j < k) { row[j] = j; } else { row[j] = -1; } } answer.push_back(row); } sort(vals.begin(), vals.end()); for (auto& x: vals) score += abs(x - vals[n / 2]); allocate_tickets(answer); return score; } return 0; }
#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...