Submission #124941

# Submission time Handle Problem Language Result Execution time Memory
124941 2019-07-04T07:45:05 Z imsifile Bulb Game (FXCUP4_bulb) C++17
Compilation error
0 ms 0 KB
#include "bulb.h"
using namespace std;

int N, cn0, cn1, os[1001001], chk[1001001], ans[1001001], nod[1001001], fu;
vector<int> L, R;

void dfs(int par, int ix){
	if(ix==-1) return;
	if(ix==-2){
		if(cn1==0) fu=1;
		if(cn1==2) ans[os[0]]=1, ans[os[1]]=1;
		if(cn1==1) ans[os[0]]=1, nod[par]++;
		return;
	}
	cn0++, chk[ix]=0, dfs(ix, L[ix]);
	cn0--, os[cn1++]=ix, chk[ix]=1, dfs(ix, R[ix]);
	cn1--, chk[ix]=-1;
}

int FindWinner(int N_, int T, vector<int> L_, vector<int> R_){
	N=N_; L=L_; R=R_;
	for(int i=1; i<=N; i++) chk[i]=-1;
	dfs(0, 1);
	if(fu) return 0;
	return 0;
}

// Current State: 0 0 0 0 0 0 0
//  -2 Bulb Path: 1 0 ? ? 1 ? ?
//                x o . . x . .
//  Availability: x o o o x o o
//  Availability는 전체에서 몇개 빠지거나 Path에서 몇개 빠진 형태.

Compilation message

/tmp/cc6AJbD7.o: In function `main':
grader.cpp:(.text.startup+0x159): undefined reference to `FindWinner(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status