제출 #362754

#제출 시각아이디문제언어결과실행 시간메모리
362754mosiashvililuka게임 (IOI14_game)C++14
42 / 100
1082 ms3564 KiB
//#include "game.h"
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,msh[1509],zm[1509],k[1509],cnt,bo[1509];
int B[1509][1509];
void initialize(int n) {
	a=n;
}
void dfs(int q){
	bo[q]=cnt;e++;
	for(int h=0; h<a; h++){
		if(h!=q&&bo[h]!=cnt&&B[q][h]==0) dfs(h);
	}
}
int hasEdge(int qqa, int qqb) {
	c=qqa;d=qqb;
	cnt++;
	B[c][d]=1;
	B[d][c]=1;
	e=0;
	dfs(1);
	if(e==a){
		return 0;
	}else{
		B[c][d]=0;
		B[d][c]=0;
		return 1;
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...