多校
NaCl__
这个作者很懒,什么都没留下…
展开
-
Buildings
Your current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the floor building with walls to make apartments in the shape of a rectangl原创 2015-07-23 22:09:23 · 461 阅读 · 0 评论 -
Delicious Apples(多校联合训练)
Problem DescriptionThere are n apple trees planted along a cyclic road, which is L metres long. Your storehouse is built at position 0 on that cyclic road. The ith tree is planted at position xi, clo原创 2015-07-24 17:02:57 · 456 阅读 · 0 评论 -
2016 Multi-University Training Contest 1 Abandoned country
这题先求出最小生成树,然后在最小生成树中求任意两个点之和的平均数。。因为最小生成树是唯一的,所以期望也就只有一个。求最小生成树的时候把树存起来。求任意两点之和的时候我们求出一条边在求和的时候用了多少次,也就是求该边的左右端点有多少个比如一条边左右两边有A,B个端点,那么利用的次数也就是A*B。 我们可以用dfs来实现,用sum数组表示k点子树上的点(包括他自己),那么kf父亲那边的点就是n-sum原创 2016-07-20 20:47:11 · 507 阅读 · 0 评论