CF339D
底层 或 上层 异或
题意 这题其实很有意思的 首先给你 n 和 Q
然后给你 2^n个数字 也就是一颗满的线段树
然后对底层 他是不处理 底层的上一层 用 | 去合并
然后再上一层 用 ^ 去合并
再上一层 用 | 去合并
以此类推
这样的话其实这题很骚
也就是教会了我们在up函数魔改
首先build 到底层的时候那么就是 col[rt] = -1 然后 上一层就是col[rt<<1] + 1 = 0
再上一层 就是 0 + 1 = 1
那么我们只要在up的时候判断奇偶来决定是 | 还是 ^ 就行了
/*
if you can't see the repay
Why not just work step by step
rubbish is relaxed
to ljq
*/
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <cmath>
#include <map>
#include <stack>
#include <set>
#include <sstream>
#include <vector>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define dbg2(x1,x2) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<endl
#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<" "<<#x3<<" = "<<x3<<endl
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define lc (rt<<1)
#define rc (rt<<11)
#define mid ((l+r)>>1)
typedef pair<int,int> pll;
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int _inf = 0xc0c0c0c0