제출 #1119909

#제출 시각아이디문제언어결과실행 시간메모리
1119909dsyz카니발 티켓 (IOI20_tickets)C++17
0 / 100
1 ms512 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; using ll = long long; #define MAXN (1000005) long long find_maximum(int k, vector<vector<int>> x) { ll N = x.size(); ll M = x[0].size(); vector<ll> all; for(ll i = 0;i < N;i++){ for(ll j = 0;j < M;j++){ all.push_back(x[i][j]); } } sort(all.begin(),all.end()); pair<ll,ll> best = {-1,-1}; for(auto b : all){ ll sum = 0; for(ll i = 0;i < N;i++){ sum += abs(b - x[i][0]); } best = max(best,{sum,b}); } vector<vector<int> > ans; for(ll i = 0;i < N;i++){ vector<int> row; row.push_back(0); ans.push_back(row); } allocate_tickets(ans); return best.first; }
#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...