The 15th Chinese Northeast Collegiate Programming Contest D. Lowbit「势能线段树」
D. Lowbit题目描述:两种操作给区间的每个数x加上他们的lowbit(x)求区间和思路:经典势能线段树一个非2的幂次方的数字加lowbit几次后一定会变成2的幂次方,此时再加lowbit,就相当于乘2#include <bits/stdc++.h>using namespace std;#define endl '\n'#define inf 0x3f3f3f3f#define mod 998244353#define m_p(a,b) make_p
原创
2022-05-17 21:16:31 ·
145 阅读 ·
0 评论