# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
149411 | Cafe Maru (#200) | Bulb Game (FXCUP4_bulb) | C++17 | 144 ms | 24540 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bulb.h"
const int RED = -1;
const int BLUE = -2;
using vi = std::vector<int>;
const int NMAX = 300000;
bool c[NMAX*4+3];
void SetTrue(int nl,int nr,int l,int r,int node){
if(l<=nl&&nr<=r){
c[node]=true; return;
}
else if(nr<l||r<nl) return;
int mid = (nl+nr)/2;
SetTrue(nl,mid,l,r,node*2+1);
SetTrue(mid+1,nr,l,r,node*2+2);
}
int N;
void SetTrue(int l,int r){if(l<=r) SetTrue(0,N-1,l,r,0);}
bool ReadBool(int nl,int nr,int x,int node){
if(c[node]) return true;
if(nl==nr) return c[node];
int mid = (nl+nr)/2;
if(x<=mid) return ReadBool(nl,mid,x,node*2+1);
else return ReadBool(mid+1,nr,x,node*2+2);
}
bool ReadBool(int x){return ReadBool(0,N-1,x,0);}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |