#include #include #include using namespace std;vector tree;vector a;int N, Q;// 세그먼트 트리 구축void build() { for (int i = 0; i 0; --i) { tree[i] = tree[i 1) { where >>= 1; tree[where] = tree[where >= 1; right >>= 1; } return sum;}int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> N >> Q; a.resize(N); tree.resi..