# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
882936 | NotLinux | Palembang Bridges (APIO15_bridge) | C++17 | 109 ms | 5604 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.
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
// PUT IT BEFORE THE INCLUDE
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 7;
template<class T, class Container = vector<T>, class Compare = less<T>>
struct PriorityQueue {
int sz = 0;
priority_queue<T, Container, Compare> pq, del;
void emplace(const T &val) { pq.emplace(val); ++sz; }
void erase(const T &val) { del.emplace(val); --sz; }
void pop() { erase(top()); }
T top() {
while (!del.empty() && !pq.empty() && del.top() == pq.top()) del.pop(), pq.pop();
return pq.top();
}
int size() const {return sz;}
};
template<class T>
struct MedianHeap {
long long sumlo = 0 , sumhi = 0;
PriorityQueue<T> lo;
PriorityQueue<T, vector<T>, greater<T>> hi;
void Fix() {
while (hi.size() > lo.size()){
sumlo += hi.top();
# | 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... |