제출 #136158

#제출 시각아이디문제언어결과실행 시간메모리
136158zoooma13게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" #include "game.h" using namespace std; #define MAX_N 1503 int n; set <int> adj[MAX_N]; void initialize(int N) { n = N; for(int u=0; u<n; u++) for(int v=u+1; v<n; v++){ adj[u].insert(v); adj[v].insert(u); } } int conn = 0; bool vis[MAXN]; void dfs(int u){ vis[u] = 1; conn++; for(auto&v : adj[u]) if(!vis[v]) dfs(v); } int hasEdge(int u, int v) { adj[u].erase(v); adj[v].erase(u); memset(vis ,0 ,sizeof vis); conn = 0; dfs(u); if(conn == n) return 0; adj[u].insert(v); adj[v].insert(u); return 1; }

컴파일 시 표준 에러 (stderr) 메시지

game.cpp:20:10: error: 'MAXN' was not declared in this scope
 bool vis[MAXN];
          ^~~~
game.cpp:20:10: note: suggested alternative: 'MAX_N'
 bool vis[MAXN];
          ^~~~
          MAX_N
game.cpp: In function 'void dfs(int)':
game.cpp:22:5: error: 'vis' was not declared in this scope
     vis[u] = 1;
     ^~~
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:31:12: error: 'vis' was not declared in this scope
     memset(vis ,0 ,sizeof vis);
            ^~~