十七

acwing847. 图中点的层次

bfs模板queue<int> q;st[1] = true; // 表示1号点已经被遍历过q.push(1);while (q.size()){ int t = q.front(); q.pop(); for (int i = h[t]; i != -1; i = n

十七 Published on 2021-03-17
Previous Next