# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
762435 | goodbyehanbyeol | Bulb Game (FXCUP4_bulb) | C++17 | 107 ms | 40648 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |