# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
985854 | siewjh | Sequence (APIO23_sequence) | C++17 | 710 ms | 82260 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 "sequence.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
struct node{
int s, e, m, mn, mx, lazy;
node *l, *r;
node (int _s, int _e){
s = _s, e = _e, m = (s + e) >> 1; mn = s, mx = e, lazy = 0;
if (s != e){
l = new node(s, m);
r = new node(m + 1, e);
}
}
void update(int x, int y, int v){
if (x == s && y == e){
mn += v; mx += v; lazy += v;
return;
}
else if (y <= m) l->update(x, y, v);
else if (x > m) r->update(x, y, v);
else{
l->update(x, m, v); r->update(m + 1, y, v);
}
mn = min(l->mn, r->mn) + lazy;
mx = max(l->mx, r->mx) + lazy;
}
int mnq(int x, int y){
if (x == s && y == e) return mn;
# | 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... |