제출 #113965

#제출 시각아이디문제언어결과실행 시간메모리
113965baqargam게임 (IOI14_game)C++14
0 / 100
3 ms640 KiB
#include<bits/stdc++.h> #include "game.h" using namespace std; int n,m,k,l,i,j,a,b,col[1505],sz[1505],d[1505][1505]; void initialize(int n) { for(int i=0;i<n*(n-1)/2;i++) { cin>>a>>b; cout<<hasEdge(a,b); } } void unite(int a,int b){ sz[a]+=sz[b]; for(int i=0;i<n;i++){ if(col[i]==b) col[i]=a; d[a][i]+=d[b][i]; } } int hasEdge(int u, int v) { if(d[col[a]][col[b]]+1==sz[a]*sz[b]) { unite(col[a],col[b]); return 1; } else return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...