# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
701898 | dattranxxx | Palembang Bridges (APIO15_bridge) | C++11 | 61 ms | 5656 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 ll = long long;
const int N = 1e5 + 5;
int n, k;
#define fi first
#define se second
priority_queue<int> L, R;
ll f[N], cur = 0, sumL = 0, sumR = 0;
void insert(int x) {
if (L.empty() || x <= L.top()) {
L.emplace(+x);
sumL += x;
} else {
R.emplace(-x);
sumR += x;
}
if (L.size() > R.size() + 1) {
int x = L.top();
R.emplace(-x);
sumR += x;
L.pop();
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |