My birthday is coming up and traditionally I’mserving pie. Not just one pie, no, I have a numberN of them, of various tastes and of various sizes. Fof...
分类:
其他好文 时间:
2015-08-09 22:19:12
阅读次数:
101
DescriptionBefore the invention of book-printing, it was very hard to make a copy of a book. All the contents had to be re-written by hand by so calle...
分类:
其他好文 时间:
2015-08-09 22:18:20
阅读次数:
130
Given several segments of line (int the X axis) with coordinates [Li, Ri].You are to choose the minimalamount of them, such they would completely cove...
分类:
其他好文 时间:
2015-08-09 22:14:58
阅读次数:
133
DescriptionBefore the invention of book-printing, it was very hard to make a copy of a book. All the contents had to be re-written by hand by so calle...
分类:
其他好文 时间:
2015-08-08 17:55:43
阅读次数:
115
DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping ...
分类:
其他好文 时间:
2015-08-07 22:03:44
阅读次数:
107
Given several segments of line (int the X axis) with coordinates [Li , Ri ]. You are to choose the minimal amount of them, such they would completely ...
分类:
其他好文 时间:
2015-08-06 22:10:06
阅读次数:
100
My birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. ....
分类:
其他好文 时间:
2015-08-06 11:00:01
阅读次数:
104
/proc/meminfo Explained "Free," "buffer," "swap," "dirty." What does it all mean? If you said, "something to do with the Summer of ‘68", you may need a primer on ‘meminfo‘. The entries in the /proc...
分类:
其他好文 时间:
2015-08-05 20:35:31
阅读次数:
170
A. CodeForces 396C
题意就不描述啦。
对于第一种操作 1 v x k,我们可以给v的子树全部加上(x+depth[v]*k)的值。
对于第二种操作 2 v。查询每个节点的值之后,只需要在减去depth[v]*K即可得到答案了。里面的K是对v这个节点有影响的k的和。
自己在纸上推推公式,很容易就能知道为何是对的了
这里用两个树状数组即可维护,
当然增加整棵子树的操作...
分类:
其他好文 时间:
2015-08-03 19:13:38
阅读次数:
136
Today on a lecture about strings Gerald learned a new definition of string equivalency. Two stringsaandbof equal length are calledequivalentin one of ...
分类:
其他好文 时间:
2015-08-02 19:57:29
阅读次数:
623