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>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
ll sum[1505],ans=1e18;
long long find_maximum(int k, std::vector<std::vector<int> > x) {
int n = x.size();
int m = x[0].size();
std::vector<std::vector<int> > answer;
if(m==1){
// subtask 1
for(int i=0; i<n; i++){
sum[i]+=x[i][0];
if(i!=0) sum[i]+=sum[i-1];
}
for(int i=0; i<n; i++){
// x[i][0]
ll cnt=x[i][0]*(i+1)-sum[i];
cnt+=sum[n-1]-sum[i]-(n-i-1)*x[i][0];
ans=min(ans,cnt);
}
answer.resize(n);
for(int i=0; i<n; i++){
answer[i].resize(m);
}
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
answer[i][j]=0;
}
}
allocate_tickets(answer);
return ans;
}
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... |