Submission #825216

#TimeUsernameProblemLanguageResultExecution timeMemory
825216Marco_EscandonCarnival Tickets (IOI20_tickets)C++14
0 / 100
739 ms2097152 KiB
#include "tickets.h" #include <vector> #include<bits/stdc++.h> using namespace std; typedef long long ll; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); int m = x[0].size(); std::vector<std::vector<int>> answer; ll me=0; for (int i = 0; i < n; i++) { std::vector<int> row(m); row[0] = x[i][0]; m+=x[i][0]; answer.push_back(row); } me/=n; ll bs=10000000000000; for(int i=me-2; i<me+2; i++) { ll st=0; for (int j = 0; j < n; j++) { if (j < k) { st=abs(x[j][0]-i); } } bs=min(bs,st); } allocate_tickets(answer); return bs; }
#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...