#include "tickets.h"//
#include <bits/stdc++.h>
#define int long long
using namespace std;
int n, m;
vector<int> chi;
long long find_maximum(int32_t k, vector<vector<int32_t>> x) {
n = x.size();
m = x[0].size();
if (m != 1) return 8;
long long jav = 0;
vector<vector<int32_t>> answer;
for (int i = 0; i < n; i++) {
vector<int32_t> row(m);
for (int j = 0; j < m; j++) {
row[j] = 0;
chi.push_back(x[i][j]);
}
answer.push_back(row);
}
allocate_tickets(answer);//
sort(chi.begin(), chi.end());
int tmp = chi[chi.size() >> 1];
for (auto i : chi) jav += abs(i - tmp);
return jav;
}
//int32_t main() {}//
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
2 ms |
716 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
WA in grader: failure to call allocate_tickets |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
WA in grader: failure to call allocate_tickets |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
WA in grader: failure to call allocate_tickets |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
WA in grader: failure to call allocate_tickets |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
WA in grader: failure to call allocate_tickets |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
2 ms |
716 KB |
Output is correct |
7 |
Incorrect |
0 ms |
204 KB |
WA in grader: failure to call allocate_tickets |
8 |
Halted |
0 ms |
0 KB |
- |