Submission #541868

#TimeUsernameProblemLanguageResultExecution timeMemory
541868LucaDantasCarnival Tickets (IOI20_tickets)C++17
11 / 100
2 ms724 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(); int m = x[0].size(); if(m == 1) { long long ans = 0; vector<vector<int>> build(n, vector<int>(1, 0)); sort(x.begin(), x.end(), [](const vector<int>& v1, const vector<int>& v2) { return v1.front() < v2.front(); }); for(int i = 0; i < n; i++) ans += x[i].front() * (i < n / 2 ? -1 : 1); allocate_tickets(build); return ans; } return 0; /* int cnt[2]{}; for(auto v : x) for(int hm : v) cnt[hm]++; */ /* vector<vector<int>> escolhe(n, vector<int>); vector<int> dp(2*n*k+1, -0x3f3f3f3f), prox = dp; int offset = n*k; dp[offset] = 0; */ /* std::vector<std::vector<int>> answer; 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; } } answer.push_back(row); } allocate_tickets(answer); */ // return 1; }
#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...