标签:pre event span alt src onclick += click 树状数组
1 ll lowbit(ll x) 2 { 3 return x&-x; 4 } 5 6 void modify(ll x,ll d) 7 { 8 for(int i=x; i<=n; i+=lowbit(i)) c[i]+=d; 9 } 10 11 ll sum(ll x); 12 { 13 ll ans=0; 14 for(int i=x; i; i^=lowbit(i)) ans+=c[i]; 15 }
标签:pre event span alt src onclick += click 树状数组
原文地址:https://www.cnblogs.com/KatouKatou/p/9500683.html