제출 #399393

#제출 시각아이디문제언어결과실행 시간메모리
399393phathnvGame (IOI14_game)C++11
42 / 100
106 ms1936 KiB
#include "game.h" const int N = 80; int n, adj[N][N]; bool vst[N]; void Dfs(int u){ if (vst[u]) return; vst[u] = 1; for(int v = 0; v < n; v++) if (adj[u][v]) Dfs(v); } void initialize(int _n){ n = _n; for(int u = 0; u < n; u++) for(int v = 0; v < n; v++) adj[u][v] = 1; } int hasEdge(int u, int v){ for(int i = 0; i < n; i++) vst[i] = 0; adj[u][v] = adj[v][u] = 0; Dfs(u); if (!vst[v]) adj[u][v] = adj[v][u] = 1; return adj[u][v]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...