답안 #340728

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
340728 2020-12-28T09:55:43 Z nandonathaniel 게임 (IOI14_game) C++14
0 / 100
1 ms 364 KB
#include "game.h"
#include "bits/stdc++.h"
using namespace std;

int par[1505];

int find(int x){
	if(par[x]==x)return x;
	return par[x]=find(par[x]);
}

void join(int a,int b){
	par[find(a)]=find(b);
}

void initialize(int n) {
	for(int i=0;i<n;i++)par[i]=i;
}

int hasEdge(int u, int v) {
	if(find(u)!=find(v)){
		join(u,v);
		return 1;
	}
	else return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -