# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
114075 | keko37 | Fireworks (APIO16_fireworks) | C++14 | 345 ms | 68600 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>
using namespace std;
typedef long long llint;
const int MAXN = 300005;
const llint INF = 1000000000000000LL;
int n, m;
llint p[MAXN], c[MAXN];
llint a[MAXN], b[MAXN];
vector <int> v[MAXN];
priority_queue <llint> hull[MAXN];
void add (int x, int len) {
int slope = a[x] + hull[x].size();
llint x1, x2;
while (slope >= 0) {
if (slope == 1) x2 = hull[x].top();
if (slope == 0) x1 = hull[x].top();
hull[x].pop(); slope--;
}
b[x] += len;
hull[x].push(x1 + len);
hull[x].push(x2 + len);
}
void spoji (int x, int y) {
if (hull[x].size() > hull[y].size()) swap(hull[x], hull[y]);
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... |