이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
///~~~LOTA~~~///
#include "tickets.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define append push_back
#define add insert
#define nl '\n'
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define terminator main
#define N 1501
int a[N];
ll find_maximum(int k,vector<vector<int>> x){
pair<ll,vector<int>> ans={0,{}};
vector<int> u;
ll r;
int n=x.size();
int m=x[0].size();
for(int i=0;i<n;i++){
vector<pll> v;
for(int j=r=0;j<n;j++){
a[j]=(i==j);
if(a[j]) continue;
r+=x[j][m-1]-x[i][0];
v.append({x[j][m-1]-x[i][0]-x[i][0]+x[j][0],j});
}
sort(all(v));
for(int j=0;j<n/2-1;j++){
r-=v[j].ff;
a[v[j].ss]=1;
}
for(int j=0;j<n;j++){
if(a[j]){
u.append(0);
if(x[j][0]>x[i][0]) r=0;
}
else{
u.append(m-1);
if(x[j][m-1]<x[i][0]) r=0;
}
}
ans=max(ans,{r,u});
u.clear();
}
vector<vector<int>> v;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++)
u.append(-1);
v.append(u);
u.clear();
}
for(int i=0;i<n;i++)
v[i][ans.ss[i]]=0;
allocate_tickets(v);
return ans.ff;
}
# | 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... |