이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "tickets.h"
#include <vector>
#include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
#define ll long long
#define vi vector<int>
#define vvi vector<vi>
ll oink(vvi x) {
//cerr << endl;
allocate_tickets(x);
int n = x.size();
ll t = 0;
vi L (n);
for (int i = 0; i < n; i++) L[i] = x[i][0];
sort(L.begin(), L.end());
int a = L[n/2];
//cerr << a << endl;
for (auto i : L) t += abs(a-i);
//cerr << endl;
return t;
}
long long find_maximum(int k, vvi x) {
int n = x.size();
int m = x[0].size();
if (m == 1) return oink(x);
vvi answer;
for (int i = 0; i < n; i++) {
vi 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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |