Submission #296946

#TimeUsernameProblemLanguageResultExecution timeMemory
296946tmwilliamlin168Game (IOI14_game)C++14
42 / 100
71 ms640 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; const int mxN=80; int n; bool adj[mxN][mxN], vis[mxN]; void initialize(int n) { ::n=n; for(int i=0; i<n; ++i) for(int j=0; j<n; ++j) adj[i][j]=1; } int dfs(int u) { int s=1; vis[u]=1; for(int v=0; v<n; ++v) if(adj[u][v]&&!vis[v]) s+=dfs(v); return s; } int hasEdge(int u, int v) { adj[u][v]=adj[v][u]=0; memset(vis, 0, n); adj[u][v]=adj[v][u]=dfs(0)<n; return adj[u][v]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...