# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
150518 | | 욱방켜!! (twitch.tv/wookje) (#200) | Bulb Game (FXCUP4_bulb) | C++17 | | 117 ms | 5112 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"
#include <bits/stdc++.h>
int FindWinner(int T, std::vector<int> L, std::vector<int> R){
int N = L.size(), c, n;
for(int i=0;i<N;i++) {
bool valid=true, chk=false;
for(c=0;c>=0;c=c==i ? R[c]:L[c]) {
if((c==i ? L[c]:R[c])>=0) chk=true;
for(n=c==i ? L[c]:R[c];n>=0;n=n==i ? R[n]:L[n]);
if(n==-2) {
valid=false;
break;
}
}
if(valid && (!chk || 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... |