제출 #23690

#제출 시각아이디문제언어결과실행 시간메모리
23690Hiasat게임 (IOI14_game)C++14
0 / 100
0 ms10824 KiB
#include "game.h" #include <iostream> #include <cstdio> #include <set> #include <vector> using namespace std; int dsu[2010]; int rem[2010]; int find(int u){ return dsu[u] == u ? u : dsu[u] = find(dsu[u]); } void initialize(int n) { for (int i = 0; i < n; ++i){ dsu[i] = i; rem[i] = n-1; } } int hasEdge(int u, int v) { int a = find(u); int b = find(v); rem[a]--; rem[b]--; if(a == b){ return 0; } if(rem[a] == 0 || rem[b] == 0){ rem[b] += rem[a]; dsu[a] = b; return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...