Submission #305263

#TimeUsernameProblemLanguageResultExecution timeMemory
305263chubyxdxdCarnival Tickets (IOI20_tickets)C++17
11 / 100
4 ms768 KiB
#include "tickets.h" #include <bits/stdc++.h> #include <vector> typedef long long ll; using namespace std; long long find_maximum(int k, vector<vector<int>> x) { ll n = x.size(); ll m = x[0].size(); ll ans=1e18; vector<vector<int>> answer; for(int i=0;i<n;i++){ answer.push_back(vector<int>(m,-1)); } if(m==1){ for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ answer[i][j]=0; } } for(int i=0;i<n;i++){ ll currans=0; for(int j=0;j<n;j++){ currans+=abs(x[i][0]-x[j][0]); } ans=min(ans,currans); } } allocate_tickets(answer); return ans; }
#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...