唯一做出来的第二道题
```
int findMinCnt(unordered_map<int, vector<pair<int, bool>>>& tree, int root)
{
//get from root min nums of workers need send to sub tree
//返回以当前为根发送最少数量
if (tree.find(root) == tree.end())
{
return 0;
}
auto sub_roots = tree[root];
int ret = 0;
for (auto [sub_root, path_ok] : sub_roots)
{
if (path_ok)
{
ret += max(findMinCnt(tree, sub_root), 0);
}
else
{
ret += max(findMinCnt(tree, sub_root), 1);
}
}
return ret;
}
```