제출 #319197

#제출 시각아이디문제언어결과실행 시간메모리
319197northlake카니발 티켓 (IOI20_tickets)C++17
11 / 100
2 ms748 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; long long find_maximum(int k, vector<vector<int>> x) { int length = x.size(); vector<vector<int>> s {}; for (int i = 0; i < length; i++) s.push_back({0}); allocate_tickets(s); vector<int> values {}; for (auto el : x) values.push_back(el[0]); sort(values.begin(), values.end()); int optimal_value = values[length/2]; long long result = 0ll; for (auto el : x) { result += static_cast<long long>(abs(optimal_value-el[0])); } return result; }
#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...