一维树状数组
· 单点修改 + 单点查询:
直接使用即可
· 区间修改 + 单点查询:
另外维护一个维护前缀和的树状数组,查询时查询与原值相加即可。
· 区间修改 + 区间查询:
<div align=center> 居中 </div>
原文地址:https://www.cnblogs.com/Colythme/p/9853159.html
时间: 2024-08-29 01:22:32
一维树状数组
· 单点修改 + 单点查询:
直接使用即可
· 区间修改 + 单点查询:
另外维护一个维护前缀和的树状数组,查询时查询与原值相加即可。
· 区间修改 + 区间查询:
<div align=center> 居中 </div>
原文地址:https://www.cnblogs.com/Colythme/p/9853159.html