이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#ifndef ARTHUR_LOCAL
#include "tickets.h"
#endif
using ll = long long;
#define len(x) int((x).size())
#ifdef ARTHUR_LOCAL
void allocate_tickets(vector<vector<int>> ans)
{
for(auto a:ans)
{
for(auto b:a) cout << b << " ";
}
}
#endif
ll find_maximum(int k, vector<vector<int>> X)
{
int n = len(X);
int m = len(X[0]);
vector<vector<int>> answer;
vector<ll> vals;
for (int i = 0; i < n; i++)
{
vector<int> row(m);
for(int j = 0; j < m; j++)
{
row[j]=0;
vals.push_back(X[i][j]);
}
answer.push_back(row);
}
sort(vals.begin(),vals.end());
ll mid = vals[int(n/2)];
ll ans=0LL;
for(auto v:vals) ans += abs(v-mid);
allocate_tickets(answer);
return ans;
}
# | 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... |