I. GZP and CS GZP love to play Counter-Strike(CS). One day GZP was playing a mod of CS. The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to…
F. GZP and Poker GZP often plays games with his friends.Today they went to a board game.There are n players(including GZP) and all of them have some virtual money on the table. ith of them has ai yuan. Each player can double his virtual wealth any nu…
题目链接 The 17th Zhejiang University Programming Contest Problem B 题意 给定一棵树,现在要加一条连接$1$(根结点)和$x$的边,求加了这条边之后,所有点到根结点的距离的和的最小值. 输出这个最小值即可. 当加的这条边为$1-x$时,$x$和$1$的中点及以下的所有点到根结点的距离都发生了变化,其他点都没有发生改变. 现在设$ans[i]$表示当加的这条边为$1-x$时的答案,考虑答案从某个点转移到他的儿子. 首先树型DP预处…