2660 auto flag = vector(n,
false);
2661 auto edge = vector(n, unordered_set<unsigned short>());
2662 for(
unsigned short i = 0; i < m; i++) {
2664 edge[a - 1].insert(b - 1);
2665 edge[b - 1].insert(a - 1);
2668 auto que = queue<pair<unsigned short, unsigned short>>();
2669 que.push(pair(0, 0));
2671 while(!que.empty()) {
2672 auto [prev, current] = que.front();
2674 for(
auto next: edge[current]) {
2683 que.push(pair(current, next));
2689 for(
unsigned short i = 0; i < n; i++) {