Submission #832317

#TimeUsernameProblemLanguageResultExecution timeMemory
832317JohannCarnival Tickets (IOI20_tickets)C++14
11 / 100
1 ms596 KiB
#include "tickets.h" #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() long long find_maximum(int k, std::vector<std::vector<int>> x) { int N = x.size(); int M = x[0].size(); vvi ans(N, vi(M, 0)); allocate_tickets(ans); vi allValues; for (int i = 0; i < N; ++i) for (int j = 0; j < M; ++j) allValues.push_back(x[i][j]); sort(all(allValues)); ll value = 0; for (int i = 0; i < sz(allValues) / 2; ++i) value += allValues[sz(allValues) - 1 - i] - allValues[i]; return value; }
#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...