# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
113252 | njchung99 | 벽 (IOI14_wall) | C++14 | 1275 ms | 69496 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "wall.h"
#include<cstdio>
#include<algorithm>
using namespace std;
int mi[8000000], ma[8000000];
int *dap;
void update(int lo, int hi, int val, int node, int x, int y, int p) {
if (hi < x || y < lo)return;
if (lo <= x && y <= hi) {
if (p == 1) {
mi[node] = max(mi[node], val);
ma[node] = max(ma[node], val);
}
else if (p == 2)
{
mi[node] = min(mi[node], val);
ma[node] = min(ma[node], val);
}
if (x == y)
dap[x] = ma[node];
return;
}
int ll = node * 2;
int rr = node * 2 + 1;
int mid = (x + y) / 2;
mi[ll] = min(mi[ll], mi[node]); mi[rr] = min(mi[rr], mi[node]);
ma[ll] = min(ma[ll], mi[node]); ma[rr] = min(ma[rr], mi[node]);
mi[ll] = max(mi[ll], ma[node]); mi[rr] = max(mi[rr], ma[node]);
ma[ll] = max(ma[ll], ma[node]); ma[rr] = max(ma[rr], ma[node]);
ma[node] = 0; mi[node] = 1234567890;
# | 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... |