摘要: 题目大意: lowbit(x)是x的最低位1 区间修改 ai+lowbit(ai) 区间和查询 n,m<1e5 题解: 一个数x最多加log(x)次lowbitx就会变成2的幂,2的幂加lowbitx相当于x2,标记区间是否都为2的幂,若是则区间每个数x2,不是则暴力修改。 #include<bit 阅读全文
posted @ 2021-09-05 18:58 ANhour 阅读(115) 评论(0) 推荐(0) 编辑
摘要: q次询问,每次求出边长大于k构成图中能两两互达的点的对数。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define LL long long cons 阅读全文
posted @ 2021-09-05 18:48 ANhour 阅读(41) 评论(0) 推荐(0) 编辑