# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
686651 | cig32 | The short shank; Redemption (BOI21_prison) | C++14 | 1928 ms | 106400 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.
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
const int MAXN = 2e6 + 5;
const int MOD = 1e9 + 7;
int stma[MAXN << 2], stupd[MAXN << 2], stidx[MAXN << 2];
void build(int l, int r, int idx) {
if(l == r) {
stidx[idx] = l; return;
}
int mid = (l + r) >> 1;
build(l, mid, (idx<<1)+1);
build(mid+1, r, (idx<<1)+2);
stma[idx] = max(stma[(idx<<1)+1], stma[(idx<<1)+2]);
stidx[idx] = (stma[(idx<<1)+1] == stma[idx] ? stidx[(idx<<1)+1] : stidx[(idx<<1)+2]);
}
void u(int l, int r, int constl, int constr, int idx, int val) {
if(l <= constl && constr <= r) {
stma[idx] += val;
stupd[idx] += val;
return;
}
int mid = (constl + constr) >> 1;
stma[(idx<<1)+1] += stupd[idx];
stma[(idx<<1)+2] += stupd[idx];
stupd[(idx<<1)+1] += stupd[idx];
stupd[(idx<<1)+2] += stupd[idx];
# | 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... |