# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
148008 | imsifile | Bulb Game (FXCUP4_bulb) | C++17 | 133 ms | 25508 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bulb.h"
using namespace std;
int N, dlr[303030][2], dcn, par[303030], sw[303030], qsc, cha, ch[2], valid=-1, lose[303030];
vector<int> L, R;
int lca(int a, int b){
if(a==-1) return b;
if(a==-2) return a;
while(a>=0){
if(dlr[a][0] <= dlr[b][0] && dlr[b][0] <= dlr[a][1]) break;
a=par[a];
}
return a;
}
void pre(int ix){
if(ix<0) return;
dlr[ix][0]=dcn++;
pre(L[ix]), pre(R[ix]);
dlr[ix][1]=dcn-1;
}
void dfs(int pv, int ix){
if(ix==-1) return;
if(ix==-2){
if(cha==0) valid=-2;
if(cha==1 && qsc) valid=lca(valid,pv), lose[ch[0]]=1;
if(cha==2) lose[ch[0]]=lose[ch[1]]=1;
return;
컴파일 시 표준 에러 (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... |