线性基求交集

L_B Merge(L_B A, L_B B){
    L_B C, ALL;
    C.init(), ALL.init();
    ui cnt[35];
    for(int i = 0; i <= 31; i++){
        C.b[i] = A.b[i];
        cnt[i] = (1u << i);
    }
    for(int i = 31; i >= 0; i--){
        ui v = B.b[i];
        if(v){
            ui temp = 0;
            bool can = true;
            for(int j = 31; j >= 0; j--){
                if(v & (1u << j)){
                    if(C.b[j]){
                        v ^= C.b[j];
                        temp ^= cnt[j];
                    }else{
                        can = false;
                        C.b[j] = v;
                        cnt[j] = temp;
                        break; 
                    }
                }
            }
            if(can){
                ui k = 0;
                for(int j = 31; j >= 0; j--){
                    if(temp & (1u << j)){
                        k ^= C.b[j];
                    }
                }
//                cout << k << endl;
                Insert(ALL, k);
            }
        }
    }
    return ALL;
}