# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
164920 | gs18103 | Safety (NOI18_safety) | C++14 | 133 ms | 45060 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 eb emplace_back
#define em emplace
#define all(v) v.begin(), v.end()
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
const int MAX = 303030;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
struct Node {
priority_queue <ll> L;
priority_queue <ll, vector <ll>, greater <ll> > R;
ll ans = 0, s = 0;
void init(int x) {L.em(x), R.em(x);}
int size() {return (int)(L.size() + R.size());}
void merge(Node &X) {
ans += X.ans;
while(!X.L.empty()) {
ll temp = X.L.top() - X.s;
X.L.pop();
if(temp >= R.top() + s){
ans += temp - R.top() - s;
# | 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... |