# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
91811 | SamAnd | 원숭이와 사과 나무 (IZhO12_apple) | C++17 | 187 ms | 3192 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
const int N=100005,M=1000000000;
int t[N*120];
int ll[N*120],rr[N*120];
int z;
void ubd(int tl,int tr,int l,int r,int pos)
{
if(t[pos]==(tr-tl+1))
return;
if(tl==l && r==tr)
{
t[pos]=r-l+1;
return;
}
int m=(tl+tr)/2;
if(r<=m)
{
if(!ll[pos])
ll[pos]=++z;
ubd(tl,m,l,r,ll[pos]);
}
else if(l>m)
{
if(!rr[pos])
rr[pos]=++z;
ubd(m+1,tr,l,r,rr[pos]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |