__树状数组
BigZong
这个作者很懒,什么都没留下…
展开
-
树状数组模板+前缀和+线段树
树状数组的数据结构,它能在O(logn)内对数组的值进行修改和查询某一段数值的和。 区间更新,单点求和的做题心路: 首先是HDU 1556 算是做树状数组的第一个模板例题,然后看着板子,竟然写错了,还是没有理解板子的意思 HDU - 1556 这里我写成这样的了,可是这样的话,时间复杂度比直接for循环还要大,看了别人的代码后发现,我理解错了,输入y以后,直接就对前面出现的数据进行更...原创 2019-05-11 15:33:47 · 245 阅读 · 0 评论 -
Vasya and a Tree CodeForces - 1076E(+dfs+树)
Vasya has a tree consisting ofnnvertices with root in vertex11. At first all vertices has00written on it. Letd(i,j)d(i,j)be the distance between verticesiiandjj, i.e. number of edges in the...原创 2019-06-01 19:57:15 · 121 阅读 · 0 评论