Submission #686651

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6866512023-01-25 16:51:13cig32The short shank; Redemption (BOI21_prison)C++14
100 / 100
1928 ms106400 KiB
#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];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...