//E小绿的房子 #include <bits/stdc++.h> using namespace std; const int N = 100010; int n; int f[N]; //记录下与第i个点距离为1的点 int d[N]; //表示从第i个结点能到达且距离不超过2的结点数 int alls[N]; int main(){ cin >> n; ...