Submission #148818

#TimeUsernameProblemLanguageResultExecution timeMemory
148818=SUM(D1:D9) (#200)Bulb Game (FXCUP4_bulb)C++17
0 / 100
2 ms256 KiB
#include "bulb.h" int FindWinner(int T, std::vector<int> L, std::vector<int> R){ int N = L.size(); int now = 0; std::vector<int> v; while(R[now]>=0){ v.push_back(L[now]); now = R[now]; } if(R[now] == -2) return 0; for(auto &i : v){ while(R[i] >= 0) i = R[i]; if(i == -2) return 0; } return 1; }

Compilation message (stderr)

bulb.cpp: In function 'int FindWinner(int, std::vector<int>, std::vector<int>)':
bulb.cpp:4: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...