# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
762435 | goodbyehanbyeol | Bulb Game (FXCUP4_bulb) | C++17 | 107 ms | 40648 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 FindWinner(int T, std::vector<int> L, std::vector<int> R){
int n = L.size();
vector<vector<int>> way(n, vector<int>(2));
for(int i = 0; i < n; ++i){
way[i][0] = L[i];
way[i][1] = R[i];
}
vector<int> tchk(n), ocnt(n);
int mn = (int)1e9;
vector<int> diff;
auto dfs = [&](auto&&self, int x, int pre)->void{
if(x == -2){
mn = min(mn, (int)diff.size());
if((int)diff.size() == 2){
tchk[diff[0]] = tchk[diff[1]] = 1;
}
if((int)diff.size() == 1){
ocnt[pre] += 1;
}
return;
}
if(x == -1) return;
self(self, way[x][0], x);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |