#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();
vector<std::vector<int>> answer(n,vector<int>(1,1));
long long price = 0;
vector<int> prices;
for(int i = 0;i<n;i++){
prices.push_back(x[i][0]);
}
sort(prices.begin(),prices.end());
int mid = (prices[n/2]+prices[n/2-1])/2;
for(int i = 0;i<n;i++){
price += abs(x[i][0] - mid);
}
allocate_tickets(answer);
return price;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
Ticket 0 of color 0 is played on invalid day 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
WA in grader: allocate_tickets called with parameter of wrong size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
WA in grader: allocate_tickets called with parameter of wrong size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
300 KB |
WA in grader: allocate_tickets called with parameter of wrong size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
WA in grader: allocate_tickets called with parameter of wrong size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
WA in grader: allocate_tickets called with parameter of wrong size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
Ticket 0 of color 0 is played on invalid day 1 |
2 |
Halted |
0 ms |
0 KB |
- |