제출 #592992

#제출 시각아이디문제언어결과실행 시간메모리
592992juggernaut게임 (IOI14_game)C++14
0 / 100
1 ms292 KiB
#include"game.h" #include<bits/stdc++.h> #ifdef juggernaut #include"grader.cpp" #endif using namespace std; int par[1505],sz[1505],a[1505]; int fin(int v){ return v==par[v]?v:par[v]=fin(par[v]); } void initialize(int n){ for(int i=0;i<n;i++){ par[i]=i; sz[i]=1; a[i]=n-1; } } void unite(int a,int b){ if(sz[a]<sz[b])swap(a,b); par[b]=a; sz[a]+=sz[b]; ::a[a]+=::a[b]; } int hasEdge(int a,int b){ a=fin(a); b=fin(b); ::a[a]--; ::a[b]--; if(min(::a[a],::a[b])==0){ unite(a,b); return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...