이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "tickets.h"
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef long long ll;
#define f first
#define s second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize
const int md = 1e9+7;
const ll inf = 1e18;
const int maxn = 2e3+5;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
int lst[maxn], mst[maxn];
int n, m;
bool cmp(int x, int y)
{
return lst[x]+mst[x] > lst[y]+mst[y];
}
long long find_maximum(int k, vector< vector<int> > b)
{
n = b.size(); m = b[0].size();
vector< vi > res(n, vector<int>(m, -1));
ll tot = 0;
for(int i = 0; i< n; i++)
{
res[i][0] = 0;
tot -= b[i][0];
}
vector<int> allnums;
for(int i = 0; i< n; i++) allnums.pb(i);
sort(all(allnums), cmp);
for(int i = 0; i< n/2; i++)
{
int x = allnums[i];
res[x][0] = -1;
res[x].back() = 0;
tot += b[i][0] + b[i].back();
}
allocate_tickets(res);
return tot;
}
# | 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... |