이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "tickets.h"
#include <bits/stdc++.h>
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
ll find_maximum(int k,vector<vi> x)
{
int n=sz(x);
int m=sz(x[0]);
ll sum=0;
vpi v;
for (int i=0;i<n;i++)sum+=x[i][m-1];
for (int i=0;i<n;i++)v.pb({-x[i][0]-x[i][m-1],i});
sort(v.begin(),v.end());
int g=n/2;
int prog[20000]={0};
while(g--)
{
sum+=v[sz(v)-1].f;
prog[v[sz(v)-1].s]++;
v.pop_back();
}
for (int i=0;i<n;i++)
{
fill(x[i].begin(),x[i].end(),-1);
if (prog[i]==0)x[i][m-1]=0;
else x[i][0]=0;
}
allocate_tickets(x);
return sum;
}
# | 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... |