제출 #719669

#제출 시각아이디문제언어결과실행 시간메모리
719669mseebacher카니발 티켓 (IOI20_tickets)C++17
0 / 100
1 ms300 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); vector<std::vector<int>> answer(n,vector<int>(1,1)); long long price = 0; vector<int> prices; for(int i = 0;i<n;i++){ prices.push_back(x[i][0]); } sort(prices.begin(),prices.end()); int mid = (prices[n/2]+prices[n/2-1])/2; for(int i = 0;i<n;i++){ price += abs(x[i][0] - mid); } allocate_tickets(answer); return price; }
#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...