#include "tickets.h"
#include <vector>
#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();
long long prize=0;
std::vector<std::vector<int>> answer(n, std::vector<int>(m));
vector<long long>v;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
v.push_back(x[i][j]);
answer[i][j]=0;
}
}
allocate_tickets(answer);
sort(v.begin(),v.end());
long long av=v[n/2]+v[n/2 -1];
av/=2;
for(int i:v){
prize+=abs(i-av);
}
return prize;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
380 KB |
Output is correct |
6 |
Correct |
1 ms |
676 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
There is multiple tickets of color 0 on day 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
There is multiple tickets of color 0 on day 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
There is multiple tickets of color 0 on day 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
There is multiple tickets of color 0 on day 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
There is multiple tickets of color 0 on day 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
380 KB |
Output is correct |
6 |
Correct |
1 ms |
676 KB |
Output is correct |
7 |
Incorrect |
1 ms |
212 KB |
There is multiple tickets of color 0 on day 0 |
8 |
Halted |
0 ms |
0 KB |
- |