# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
150309 | 티셔츠 콜렉터 (#200) | Bulb Game (FXCUP4_bulb) | C++17 | 3 ms | 504 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 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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |