# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154265 | stefantaga | Bulb Game (FXCUP4_bulb) | C++17 | 103 ms | 20752 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 <bits/stdc++.h>
#include "bulb.h"
using namespace std;
struct bec
{
int st,dr;
}val[300005];
bool notbec (int nr)
{
if (nr==-1||nr==-2)
{
return 0;
}
return 1;
}
void dfs (int x,vector <int> &l,vector <int> &r)
{
if (notbec(l[x]))
{
dfs(l[x],l,r);
val[x].st=val[l[x]].st;
}
else
{
val[x].st=l[x];
}
if (notbec(r[x]))
{
dfs(r[x],l,r);
val[x].dr=val[r[x]].st;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |