# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
150456 | | 욱방켜!! (twitch.tv/wookje) (#200) | Bulb Game (FXCUP4_bulb) | C++17 | | 3 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bulb.h"
int FindWinner(int T, std::vector<int> L, std::vector<int> R){
int N = L.size();
for(int i=0; i<N; i++){
// M presses the switch at i
bool valid = true;
int c = 0;
for(; c>=0; c = (c==i)? R[c]:L[c]){
// S presses the switch at c
int r = (c==i)? L[c]:R[c];
for(; r>=0; r = (r==i)? R[r]:L[r]);
if(r == -2) valid = false;
}
if(valid && c == -1) return 1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |