제출 #750621

#제출 시각아이디문제언어결과실행 시간메모리
750621Abrar_Al_Samit게임 (IOI14_game)C++17
42 / 100
44 ms840 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; const int nax = 80; int g[nax][nax]; int n; bool vis[nax]; int dfs(int v) { int ret = 1; vis[v] = 1; for(int u=0; u<n; ++u) if(!vis[u] && g[v][u]!=0) { ret += dfs(u); } return ret; } void initialize(int N) { n = N; for(int i=0; i<n; ++i) { for(int j=0; j<n; ++j) if(i!=j) { g[i][j] = 2; } } } int hasEdge(int u, int v) { if(u==v) return 0; if(g[u][v]!=2) return g[u][v]; g[u][v] = g[v][u] = 0; memset(vis, 0, sizeof vis); return g[u][v] = g[v][u] = (dfs(0)!=n); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...