树状数组
文章平均质量分 80
Mizersy
这个作者很懒,什么都没留下…
展开
-
hdu4970 Killing Monsters 树状数组 区间修改
Killing MonstersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2843 Accepted Submission(s): 1070Problem DescriptionKingdom Rush is a popul...原创 2018-03-03 20:35:43 · 416 阅读 · 0 评论 -
hdu1166敌兵布阵 (树状数组 单点修改+区间查询)
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 108424 Accepted Submission(s): 45554Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek...原创 2018-03-17 15:25:27 · 308 阅读 · 0 评论 -
树状数组 区间修改+区间查询
原文链接设原数组第ii位的值为aiai,di=ai−ai−1di=ai−ai−1,则有(这里认为a0=0a0=0):ax=∑i=1xdiax=∑i=1xdi所以有:∑i=1xai=∑i=1x∑j=1idj=∑i=1x(x−i+1)di∑i=1xai=∑i=1x∑j=1idj=∑i=1x(x−i+1)di于是我们得到了:∑i=1xai=(x+1)∑i=1xdi−∑i=1xdi×i∑i=1xai=(x...转载 2018-03-17 20:51:49 · 299 阅读 · 0 评论 -
poj2481 Cows(树状数组)
Farmer John's cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his field is particularly good. Farmer John ha...原创 2018-03-24 10:26:01 · 264 阅读 · 0 评论