제출 #578776

#제출 시각아이디문제언어결과실행 시간메모리
578776thiago_bastos카니발 티켓 (IOI20_tickets)C++17
0 / 100
1 ms212 KiB
#include "tickets.h" #include <vector> #include <algorithm> #include <utility> long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); int m = x[0].size(); long long prize = 0; auto answer = std :: vector<std :: vector<int>>(n, std :: vector<int>(m, -1)); std :: vector<int> a; for(int i = 0; i < n; ++i) { for(int j = 0; j < k; ++j) a.push_back(x[i][m - k + j] + x[i][j]); for(int j = m - k; j < m; ++j) prize += x[i][j]; } std :: sort(a.begin(), a.end()); for(int i = 0; i < n * k / 2; ++i) prize -= a[i]; allocate_tickets(answer); return prize; }
#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...