가장 먼 노드. #include #include #include #include #include #define N 20001 using namespace std; bool visit[N] = { 0 }; vector adj[N]; //stack st; int maxv = 0; vector ans; queue q; queue dep; void dfs(int cur,int depth) { if (depth == maxv) { ans.push_back(cur); } if (depth > maxv) { maxv = depth; ans.clear(); ans.push_back(cur); } for (int i = 0; i < adj[cur].size(); i++) { if (visit[i] == 0) { visi..