# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
970681 | kilkuwu | Palembang Bridges (APIO15_bridge) | C++17 | 253 ms | 13500 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>
#define nl '\n'
#ifdef LOCAL
#include "template/debug.hpp"
#else
#define dbg(...) ;
#define timer(...) ;
#endif
struct MedianSolver {
std::multiset<int> pql, pqr;
int64_t suml = 0, sumr = 0;
void balance() {
while (pql.size() > pqr.size()) {
int to_move = *pql.rbegin();
pqr.insert(to_move);
pql.erase(--pql.end());
suml -= to_move;
sumr += to_move;
}
while (pqr.size() > pql.size() + 1) {
int to_move = *pqr.begin();
pql.insert(to_move);
pqr.erase(pqr.begin());
suml += to_move;
sumr -= to_move;
}
# | 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... |