摘要: 常规模板题,lowbit(x)=x& x;求和往左走,点加往右走。 c++ include define maxn 1000000 using namespace std; int arr[maxn];int n,m,x,y,d; int lowbit(int x) { return x&( x); 阅读全文
posted @ 2019-05-20 22:42 一块钱的争论 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 采用前缀和思想,用二分查找寻找区间,时间复杂度O(n+nlogn) c++ include define maxn 2000000 using namespace std; long long arr[maxn+1]; long long brr[maxn+1]; int main() { brr[ 阅读全文
posted @ 2019-05-20 01:52 一块钱的争论 阅读(135) 评论(0) 推荐(0) 编辑