#include #include #include #include #include using namespace std; ifstream in("color.in"); ofstream out("colors.out"); struct Node { int value; int n; vector neighbors; bool visited; Node(long long val) : value(val), visited(false) {} }; int bfs(Node startNode, vector& graph) { long long len = 0; queue nodeQueue; nodeQueue.push(startNode.n); while (!nodeQueue.empty()) { long long currentNode = nodeQueue.front(); nodeQueue.pop(); if (!graph[currentNode].visited) { //cout<>n; vector graph(n, 0); int num1, num2; for(int i = 0; i>num1>>num2; graph[num1-1].neighbors.push_back(num2-1); graph[num2-1].neighbors.push_back(num1-1); } for(int i = 0; i>num1; graph[i].value = num1; } for(int i = 0; imax_len) { max_len=len; } if(len