<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>树状数组 on Heeepin</title><link>https://heeeepin.com/tags/%E6%A0%91%E7%8A%B6%E6%95%B0%E7%BB%84/</link><description>Recent content in 树状数组 on Heeepin</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><lastBuildDate>Mon, 04 Apr 2022 20:35:06 +0800</lastBuildDate><atom:link href="https://heeeepin.com/tags/%E6%A0%91%E7%8A%B6%E6%95%B0%E7%BB%84/index.xml" rel="self" type="application/rss+xml"/><item><title>区域和检索</title><link>https://heeeepin.com/post/leetcode307-%E5%8C%BA%E5%9F%9F%E5%92%8C%E6%A3%80%E7%B4%A2/</link><pubDate>Mon, 04 Apr 2022 20:35:06 +0800</pubDate><guid>https://heeeepin.com/post/leetcode307-%E5%8C%BA%E5%9F%9F%E5%92%8C%E6%A3%80%E7%B4%A2/</guid><description>1 2 3 4 5 6 7 8 x &amp;amp; (x - 1) 消除掉x最后边的1位1 // 计算x最后一位1代表多少 func lowbit(x int) int { return x &amp;amp; (-x) } 所以 x &amp;amp;= x - 1 和 x -= lowbit(x) 是等价的 这道题用到了树状</description></item></channel></rss>