#Battle

1013 Battle Over Cities (25 分)

Itisvitallyimportanttohaveallthecitiesconnectedbyhighwaysinawar.Ifacityisoccupiedbytheenemy,allthehighwaysfrom/towardthatcityareclosed.Wemustknowimmediatelyifwe...
代码星球 ·2020-08-09

Codeforces 1045D Interstellar battle 概率期望

原文链接https://www.cnblogs.com/zhouzhendong/p/CF1045D.html  给定一棵有$n$个节点的树,第$i$个节点有$p_i$的概率消失。有$q$次操作,每次操作修改一个节点消失的概率,请你在每一次操作之后输出树的期望连通块个数。  $n,qleq10^5$  首先我们考虑如何...

pat 1013 Battle Over Cities(25 分) (并查集)

1013 BattleOverCities(25 分)Itisvitallyimportanttohaveallthecitiesconnectedbyhighwaysinawar.Ifacityisoccupiedbytheenemy,allthehighwaysfrom/towardthatci...
代码星球 ·2020-06-08

1013. Battle Over Cities (25)

Itisvitallyimportanttohaveallthecitiesconnectedbyhighwaysinawar.Ifacityisoccupiedbytheenemy,allthehighwaysfrom/towardthatcityareclosed.Wemustknowimmediatelyifwe...
代码星球 ·2020-04-08