# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569705 | SSRS | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 3075 ms | 105832 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;
const long long INF1 = 1000000000000;
const long long INF2 = 100000000000000;
//RAQ+RMQ
struct lazy_segment_tree{
int N;
vector<long long> ST, lazy;
lazy_segment_tree(vector<long long> &A){
int N2 = A.size();
N = 1;
while (N < N2){
N *= 2;
}
ST = vector<long long>(N * 2 - 1, -INF2);
for (int i = 0; i < N2; i++){
ST[N - 1 + i] = A[i];
}
for (int i = N - 2; i >= 0; i--){
ST[i] = max(ST[i * 2 + 1], ST[i * 2 + 2]);
}
lazy = vector<long long>(N * 2 - 1, 0);
}
void eval(int i){
if (i < N - 1){
lazy[i * 2 + 1] += lazy[i];
lazy[i * 2 + 2] += lazy[i];
}
ST[i] += lazy[i];
lazy[i] = 0;
# | 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... |