제출 #59805

#제출 시각아이디문제언어결과실행 시간메모리
59805hamzqq9게임 (IOI14_game)C++14
0 / 100
4 ms648 KiB
#include "game.h" #include<bits/stdc++.h> using namespace std; #define N 1505 int ata[N],rem[N],n; int bul(int node) { if(ata[node]==node) return node; return ata[node]=bul(ata[node]); } void initialize(int n) { ::n=n; for(int i=0;i<n;i++) { rem[i]=n-1; ata[i]=i; } } int hasEdge(int u, int v) { int au=bul(u); int av=bul(v); rem[av]--; rem[au]--; if(rem[au]==0 || rem[av]==0) { rem[av]+=rem[au]; ata[au]=av; return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...