Submission #565865

#TimeUsernameProblemLanguageResultExecution timeMemory
565865PiejanVDCCarnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; void allocate_tickets( std::vector<std::vector<int>> _d); long long find_maximum(int k, vector<vector<int>>x) { const int n = (int)x.size(); vector<long long>v(x.size()); vector<vector<int>>ret(1, vector<int>(n)); for(int i = 0 ; i < n ; i++) v[i] = x[i][0], ret[0][i] = v[i]; allocate_tickets(x); long long mn = LLONG_MAX; for(int i = 0 ; i < n ; i++) { long long curr = 0; long long Z = v[i]; for(int j = 0 ; j < n ; j++) curr += abs(Z - v[j]); mn = min(mn, curr); } return mn; }
#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...