Submission #150309

#TimeUsernameProblemLanguageResultExecution timeMemory
150309티셔츠 콜렉터 (#200)Bulb Game (FXCUP4_bulb)C++17
0 / 100
3 ms504 KiB
#include "bulb.h" int Rcnt[300001]; int FindWinner1(int cur, std::vector<int> L, std::vector<int> R) { if (L[cur] >= 0) { Rcnt[L[cur]] = Rcnt[cur]; int tmp = FindWinner1(L[cur], L, R); if (tmp == 1) return 1; } else if (L[cur] == -1) { if (Rcnt[cur] == 1) return 1; } if (R[cur] >= 0) { Rcnt[R[cur]] = Rcnt[cur]+1; int tmp = FindWinner1(R[cur], L, R); if (tmp == 1) return 1; } else if (R[cur] == -1) { if (Rcnt[cur] == 0) return 1; } return 0; } int FindWinner(int T, std::vector<int> L, std::vector<int> R){ int N = L.size(); if (T == 1) { return FindWinner1(0, L, R); } return 0; }

Compilation message (stderr)

bulb.cpp: In function 'int FindWinner(int, std::vector<int>, std::vector<int>)':
bulb.cpp:24:6: warning: unused variable 'N' [-Wunused-variable]
  int N = L.size();
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...