# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1119903 | dsyz | Carnival Tickets (IOI20_tickets) | C++17 | 1 ms | 504 KiB |
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 <bits/stdc++.h>
#include "tickets.h"
using namespace std;
using ll = long long;
#define MAXN (1000005)
long long find_maximum(int k, vector<vector<int>> x) {
ll N = x.size();
ll M = x[0].size();
vector<ll> all;
for(ll i = 0;i < N;i++){
for(ll j = 0;j < N;j++){
all.push_back(x[i][j]);
}
}
sort(all.begin(),all.end());
pair<ll,ll> best = {-1,-1};
for(auto b : all){
ll sum = 0;
for(ll i = 0;i < N;i++){
sum += abs(b - x[i][0]);
}
best = max(best,{sum,b});
}
vector<vector<int> > ans;
vector<int> row;
for(ll i = 0;i < N;i++){
row.push_back(0);
}
ans.push_back(row);
allocate_tickets(ans);
return best.first;
}
Compilation message (stderr)
# | 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... |