This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "tickets.h"
#include <bits/stdc++.h>
#include <vector>
typedef long long ll;
using namespace std;
long long find_maximum(int k, vector<vector<int>> x) {
ll n = x.size();
ll m = x[0].size();
ll ans=1e18;
vector<vector<int>> answer;
for(int i=0;i<n;i++){
answer.push_back(vector<int>(m,-1));
}
if(m==1){
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
answer[i][j]=0;
}
}
for(int i=0;i<n;i++){
ll currans=0;
for(int j=0;j<n;j++){
currans+=abs(x[i][0]-x[j][0]);
}
ans=min(ans,currans);
}
}
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... |