# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
907382 | mickey080929 | Two Antennas (JOI19_antennas) | C++17 | 563 ms | 61008 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;
typedef long long ll;
const ll inf = 1e18;
struct Node{
ll mx, mn, ans;
};
struct Tag{
ll mx, mn;
};
struct SegmentTree{
vector<Node> tree;
vector<Tag> lazy;
void init(ll n) {
ll sz = 1 << __lg(n-1) + 2;
tree.assign(sz, {-inf, inf, -1});
lazy.assign(sz, {-inf, inf});
}
Node Merge(Node u, Node v) {
return {max(u.mx, v.mx), min(u.mn, v.mn), max(u.ans, v.ans)};
}
void propagate(ll node, ll s, ll e) {
tree[node].ans = max({tree[node].ans, lazy[node].mx - tree[node].mn, tree[node].mx - lazy[node].mn});
if (s != e) {
for (auto &i : {node*2, node*2+1}) {
Compilation message (stderr)
# | 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... |