# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
757484 | yellowtoad | Sequence (APIO23_sequence) | C++17 | 1852 ms | 101308 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 <iostream>
#include <vector>
#define int long long
using namespace std;
int n, a[500010], maxx, node[2000010][2][2], lz[2000010][2][2]; // 0: updated, 1: not updated; 0: max, 1: min
vector<int> pos[500010];
void build(int id, int x, int y) {
if (x == y) {
node[id][0][0] = node[id][0][1] = node[id][1][1] = node[id][1][0] = x;
return;
}
int mid = (x+y)/2;
build(id*2,x,mid);
build(id*2+1,mid+1,y);
node[id][0][0] = max(node[id*2][0][0],node[id*2+1][0][0]);
node[id][1][0] = max(node[id*2][1][0],node[id*2+1][1][0]);
node[id][0][1] = min(node[id*2][0][1],node[id*2+1][0][1]);
node[id][1][1] = min(node[id*2][1][1],node[id*2+1][1][1]);
}
void update(int i, int j, int id, int x, int y, int l, int r) {
if ((l <= x) && (y <= r)) {
node[id][i][j] -= 2;
lz[id][i][j] -= 2;
return;
}
if ((y < l) || (r < x)) return;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |