Submission #296945

#TimeUsernameProblemLanguageResultExecution timeMemory
296945tmwilliamlin168Game (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; const int mxN=80; int n; bool adj[mxN][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]; }

Compilation message (stderr)

game.cpp: In function 'int dfs(int)':
game.cpp:18:2: error: 'vis' was not declared in this scope
   18 |  vis[u]=1;
      |  ^~~
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:27:9: error: 'vis' was not declared in this scope
   27 |  memset(vis, 0, n);
      |         ^~~