제출 #704038

#제출 시각아이디문제언어결과실행 시간메모리
704038bebra카니발 티켓 (IOI20_tickets)C++17
11 / 100
1 ms724 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; using ll = long long; ll find_maximum(int k, vector<vector<int>> x) { int n = x.size(); int m = x[0].size(); vector<vector<int>> s(n, vector<int>(m, -1)); vector<int> a; for (int i = 0; i < n; ++i) { s[i][0] = 0; a.push_back(x[i][0]); } allocate_tickets(s); ll ans = 0; nth_element(a.begin(), a.begin() + n / 2, a.end()); for (auto x : a) { ans += abs(x - a[n / 2]); } 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...