# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
201305 | jun6873 | Fireworks (APIO16_fireworks) | C++11 | 253 ms | 89720 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;
using lint = long long;
using pint = pair<int, int>;
#define x first
#define y second
const int maxn = 300004;
int N, M;
vector<pint> g[maxn];
struct func {
priority_queue<lint> neg;
priority_queue<lint, vector<lint>, greater<lint> > pos;
lint mn = 0;
void balance() {
while (neg.top() > pos.top()) {
lint x = neg.top(), y = pos.top();
neg.pop(); pos.pop();
pos.push(x); neg.push(y);
mn += x - y;
}
}
void add(lint a, lint b, lint c) {
neg.push(a);
pos.push(b);
mn += c;
balance();
# | 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... |