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"
bool right[1001];
int FindWinner(int T, std::vector<int> L, std::vector<int> R){
int N = L.size();
if (T == 1 && N <= 1000) {
for (int i=0; i<N; i++) {
right[i] = !right[i];
bool win = true;
for (int j=0; j<N; j++) {
right[j] = !right[j];
int cur = 0;
while (cur >= 0) {
if (right[cur]) {
cur = R[cur];
} else {
cur = L[cur];
}
}
right[j] = !right[j];
if (cur == -2) {
win = false;
break;
}
}
right[i] = !right[i];
if (win) 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... |