제출 #1033077

#제출 시각아이디문제언어결과실행 시간메모리
1033077Marco_Escandon카니발 티켓 (IOI20_tickets)C++17
0 / 100
1 ms440 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; #include "tickets.h" 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 ac=0; for (int i = 0; i < n; i++) { std::vector<int> row(m); for (int j = 0; j < m; j++) { if (j < k) { row[j] = j; } else { row[j] = -1; } ac+=x[i][j]; } answer.push_back(row); } ac/=n; ll bs=1e17; for(int j=ac-2; j<ac+2; j++) { ll t1=0; for(int i=0; i<n; i++) { t1+=abs(x[i][0]-j); } bs=min(bs,t1); } 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...