이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("O1,O2,O3,Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
#include "tickets.h"
ll find_maximum(int K, vector<vector<int>> a_given) {
int N = a_given.size();
int M = a_given[0].size();
vector<vi> a(N, vi(M, 0));
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
a[i][j] = a_given[i][j];
}
}
vector<vector<int>> answer(N, vector<int>(M, -1));
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
if (j < K)
answer[i][j] = j;
}
}
ll minimum = 1e18;
for (int i = 0; i < N; i++) {
ll total = 0;
for (int j = 0; j < N; j++) {
total += abs(a[j][0] - a[i][0]);
}
minimum = min(minimum, total);
}
allocate_tickets(answer);
return minimum;
}
# | 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... |