제출 #122831

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1228312019-06-29 10:48:32turbatWall (IOI14_wall)C++14
100 / 100
803 ms82100 KiB
#include <bits/stdc++.h>
#include "wall.h"
using namespace std;
#define N 2000005
int lim[4 * N], seg[4 * N], h[N];
void clear(int nd){
seg[nd * 2] = max(seg[nd * 2], min(lim[nd * 2], seg[nd]));
seg[nd * 2 + 1] = max(seg[nd * 2 + 1], min(lim[nd * 2 + 1], seg[nd]));
lim[nd * 2] = min(lim[nd * 2], lim[nd]);
lim[nd * 2 + 1] = min(lim[nd * 2 + 1], lim[nd]);
}
void update(int nd, int L, int R, int l, int r, int h, int t){
// cout << nd << ' '<< L << ' ' << R<< endl;
if (r < L || R < l) return;
if (t == 1) h = min(h, lim[nd]);
if (l <= L && R <= r){
if (t == 1) seg[nd] = max(seg[nd], h);
else lim[nd] = min(h, lim[nd]);
return;
}
clear(nd);
update(nd * 2, L, (L + R) / 2, l, r, h, t);
update(nd * 2 + 1, (L + R) / 2 + 1, R, l, r, h, t);
}
void end(int nd, int l, int r){
if (l == r){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...