题目链接
Codeforces Round 905 (Div. 1) B. Time Travel
思路
考虑使用Dijkstra算法。
假设走到点 u u u的最短时间为 d p [ u ] dp[u] dp[u]。对于所有的出边 v v v,如果 v v v的时间标记 x x x在 d p [ u ] dp[u] dp[u]之后出现,则可以更新 d p […
官方文档
os和pathlib对比
判断当前目录下的目录
>>> p Path(.)
>>> [x for x in p.iterdir() if x.is_dir()]
[WindowsPath(data)]>>>[i for i in glob.glob("*") if os.path.isdir(i)]
[data]返回当前目录下的所有文件(…
目录 树
树是什么
术语
Root根
顶端结点 The top node in a tree.Child子节点
Parent父节点
Siblings同胞
Descendant后裔
Ancestor祖先
Branch分支
Degree度
Edge连接
Path路径
Level层次
Height of node节点高度
Height of tree树高
Depth深度
Forest森林
…