Submission #150156

# Submission time Handle Problem Language Result Execution time Memory
150156 2019-09-01T07:49:30 Z 욱방켜!! (twitch.tv/wookje)(#3584, kig9981, cheetose, jh05013) Bulb Game (FXCUP4_bulb) C++17
11 / 100
2 ms 380 KB
#include "bulb.h"
#include <bits/stdc++.h>

std::vector<int> L, R;

int FindWinner(int T, std::vector<int> L, std::vector<int> R){
	int N = L.size(), c, n, t;
	std::vector<int> t1, t2;
	::L=L; ::R=R;
	for(int i=0;i<N;i++) {
		bool valid=true;
		for(c=0;c>=0;c=c==i ? R[c]:L[c]) {
			for(n=c==i ? L[c]:R[c];n>=0;n=L[n]);
			if(n==-2) valid=false;
		}
		if(valid && c==-1) return 1;
	}
	return 0;
}

Compilation message

bulb.cpp: In function 'int FindWinner(int, std::vector<int>, std::vector<int>)':
bulb.cpp:7:26: warning: unused variable 't' [-Wunused-variable]
  int N = L.size(), c, n, t;
                          ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 296 KB Output is correct
9 Correct 2 ms 380 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -