Submission #750620

#TimeUsernameProblemLanguageResultExecution timeMemory
750620Abrar_Al_SamitGame (IOI14_game)C++17
0 / 100
1 ms312 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] = 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...