답안 #149772

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
149772 2019-09-01T07:08:47 Z Fenwick_team(#3609, amiratou, AyaBenSaad, Nucleist) Bulb Game (FXCUP4_bulb) C++17
36 / 100
1000 ms 8476 KB
#include "bulb.h"
#include <bits/stdc++.h>
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define rando mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define fi first
#define se second
#define debug(x) cerr << " - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl;
#define debugii(x) cerr << " - " << #x << ": " << x.fi<<","<<x.se << endl;
#define sep() cerr << "--------------------" << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)x.size()
#define ll long long
#define ii pair<int,int>
#define v vector<int>
#define vii vector<ii>
#define vv vector<vector<int> >
#define mp make_pair
#define INF 1000000000
#define pb push_back
#define EPS 1e-9
const int MOD = 1000000007; // 998244353
v LL,RR;
vector<int> state;
bool flow(int node){
	if(node<0){
		if(node==-2)return 1;
		return 0;
	}
	return flow((state[node]?RR[node]:LL[node]));
}

int FindWinner(int T, v L, v R){
	LL=L,RR=R;
	int N = L.size();
	state.resize(N);
	fill(all(state),0);
	for (int i = 0;i<N;i++){
		state[i]=1-state[i];
		bool f=1;
		for (int j = 0;j<N; j++){
			state[j]=1-state[j];
			if(flow(0))
				f=0;
			state[j]=1-state[j];
		}
		if(f)return 1;
		state[i]=1-state[i];
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 380 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 12 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 9 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 12 ms 376 KB Output is correct
10 Correct 9 ms 376 KB Output is correct
11 Correct 4 ms 348 KB Output is correct
12 Correct 5 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 11 ms 380 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
5 Correct 12 ms 376 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 9 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 3 ms 376 KB Output is correct
11 Correct 12 ms 376 KB Output is correct
12 Correct 9 ms 376 KB Output is correct
13 Correct 4 ms 348 KB Output is correct
14 Correct 5 ms 376 KB Output is correct
15 Correct 6 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 5 ms 348 KB Output is correct
18 Correct 2 ms 380 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 8 ms 376 KB Output is correct
21 Correct 12 ms 376 KB Output is correct
22 Correct 6 ms 376 KB Output is correct
23 Correct 9 ms 376 KB Output is correct
24 Correct 10 ms 348 KB Output is correct
25 Correct 4 ms 376 KB Output is correct
26 Correct 2 ms 380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 11 ms 380 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
5 Correct 12 ms 376 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 9 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 3 ms 376 KB Output is correct
11 Correct 12 ms 376 KB Output is correct
12 Correct 9 ms 376 KB Output is correct
13 Correct 4 ms 348 KB Output is correct
14 Correct 5 ms 376 KB Output is correct
15 Correct 6 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 5 ms 348 KB Output is correct
18 Correct 2 ms 380 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 8 ms 376 KB Output is correct
21 Correct 12 ms 376 KB Output is correct
22 Correct 6 ms 376 KB Output is correct
23 Correct 9 ms 376 KB Output is correct
24 Correct 10 ms 348 KB Output is correct
25 Correct 4 ms 376 KB Output is correct
26 Correct 2 ms 380 KB Output is correct
27 Execution timed out 1060 ms 8476 KB Time limit exceeded
28 Halted 0 ms 0 KB -