# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
150540 | | ----MIT합격선---- (#200) | Bulb Game (FXCUP4_bulb) | C++17 | | 73 ms | 8340 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>
using namespace std;
int N;
vector<int> L, R;
int f(int x, int c) {
if (c == 0) {
if (x < 0) return 1;
if (f(R[x], 1)) return 1;
int y = R[x];
while (y >= 0) y = L[y];
if (y != -1) return 0;
return f(L[x], c);
}
if (c == 1) {
if (x < 0) return 1;
if (f(R[x], 2) == 0) return 0;
return f(L[x], 1);
}
if (c == 2) {
if (x < 0) return x == -1;
return f(L[x], 2);
}
}
int FindWinner(int T, std::vector<int> LL, std::vector<int> RR){
L = LL, R = RR;
N = L.size();
int x = 0;
while (x >= 0) x = L[x];
if (x == -2) return 0;
return f(0, 0);
}
Compilation message (stderr)
bulb.cpp: In function 'int f(int, int)':
bulb.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |