Submission #565866

#TimeUsernameProblemLanguageResultExecution timeMemory
565866PiejanVDCCarnival Tickets (IOI20_tickets)C++17
0 / 100
0 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(n, vector<int>(1,1)); 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...