# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
209564 | Alexa2001 | Safety (NOI18_safety) | C++17 | 72 ms | 5524 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;
using pq_max = priority_queue<ll>;
using pq_min = priority_queue<ll, vector<ll>, greater<ll>>;
pq_max heap1;
pq_min heap2;
ll min_val = 0;
void add(int x, ll shift)
{
if(x + shift >= heap1.top() && x - shift <= heap2.top())
{
heap1.push(x + shift);
heap2.push(x - shift);
return;
}
if(x + shift < heap1.top())
{
heap1.push(x + shift);
heap1.push(x + shift);
ll out = heap1.top();
heap1.pop();
# | 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... |
# | 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... |