# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569923 | SSRS | Fireworks (APIO16_fireworks) | C++14 | 413 ms | 65088 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;
struct slope_trick{
long long mn;
priority_queue<long long> L;
priority_queue<long long, vector<long long>, greater<long long>> R;
slope_trick(){
mn = 0;
}
long long get_min(){
return mn;
}
void add_right(long long a){
if (!L.empty()){
mn += max(L.top() - a, (long long) 0);
}
L.push(a);
R.push(L.top());
L.pop();
}
void add_left(long long a){
if (!R.empty()){
mn += max(a - R.top(), (long long) 0);
}
R.push(a);
L.push(R.top());
R.pop();
}
void conv(long long a){
long long x = L.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... |