正文
增加 3 行删除 3 行
58 行未改动596061626364656667188 行未改动全部展开25625725825926026126226326413 行未改动27827928028128228328428528628 行未改动58 行未改动$$dist(i,j)=d[i]+d[j]-2\times d[lca(i,j)]$$例题2-2:[P2680 [NOIP2015 提高组] 运输计划](https://www.luogu.com.cn/problem/P2680)$2.3$ 如果需要在图中使用 LCA,则需要将图转化为树。可以通过最小/大生成树将图转化为树。例题 2-3:[P1967 [NOIP2013 提高组] 货车运输](https://www.luogu.com.cn/problem/P1967)$2.4$ 如果需要在图中使用 LCA,则需要将图转化为树。可以通过支配树将图转化为树,注意此时 LCA 要在支配树上跑。188 行未改动全部展开while(len>1)len/=g[len];```$6.2$$$d(ij)=\sum_{x\mid i}\sum_{y\mid j}[\gcd(x,y)=1]$$证明6-2:[关于题目结论证明的想法](https://www.luogu.com.cn/discuss/592630)13 行未改动证明6-4:[第一篇题解](https://www.luogu.com.cn/problem/solution/P1306)例题6-4:[P1306 斐波那契公约数](https://www.luogu.com.cn/problem/P4449)$6.5$$$\sum_{i=1}^ni[\gcd(n,i)=1]=\frac{\varphi(n)}{2}n$$特别的,若 $\varphi(n)$ 为奇数,则改为 $\frac{\varphi(n)+1}{2}n$。28 行未改动58 行未改动596061626364656667188 行未改动全部展开25625725825926026126226326413 行未改动27827928028128228328428528628 行未改动58 行未改动$$dist(i,j)=d[i]+d[j]-2\times d[lca(i,j)]$$例题2-2:[P2680 [NOIP2015 提高组] 运输计划](https://www.luogu.com.cn/problem/P2680)$2.3$ 如果需要在图中使用 LCA,则需要将图转化为树。可以通过最小/大生成树将图转化为树。例题 2-3:[P1967 [NOIP2013 提高组] 货车运输](https://www.luogu.com.cn/problem/P1967)$2.4$ 如果需要在图中使用 LCA,则需要将图转化为树。可以通过支配树将图转化为树,注意此时 LCA 要在支配树上跑。188 行未改动全部展开while(len>1)len/=g[len];```$6.2$$$d(ij)=\sum_{x\mid i}\sum_{y\mid j}[\gcd(x,y)=1]$$证明6-2:[关于题目结论证明的想法](https://www.luogu.com.cn/discuss/592630)13 行未改动证明6-4:[第一篇题解](https://www.luogu.com.cn/problem/solution/P1306)例题6-4:[P1306 斐波那契公约数](https://www.luogu.com.cn/problem/P4449)$6.5$$$\sum_{i=1}^ni[\gcd(n,i)=1]=\frac{\varphi(n)}{2}n$$特别的,若 $\varphi(n)$ 为奇数,则改为 $\frac{\varphi(n)+1}{2}n$。28 行未改动