Language: C++

#include<stdio.h>
#include<bits/stdc++.h>

using namespace std;
typedef long long       ll;
const long long      maxn = 3e5 + 7;
const long long      mod = 1e9 + 7;

struct Linear_Basis {
    ll b[63], nb[63], tot; //b为线性基  nb用来求第K小异或值 tot为nb元素个数
    bool flag = false;

    void Init() {    //初始化
        tot = 0;
        flag = false;
        memset(b, 0, sizeof(b));
        memset(nb, 0, sizeof(nb));
    }

    void Ins(ll x) { //插入
        for (long long      i = 62; i >= 0; i--) {
            if (x & (1ll << i)) {
                if (!b[i]) {
                    b[i] = x;
                    return;
                }
                x ^= b[i];
            }
        }
        flag = true;
        return;
    }

    bool Fin(ll x) { //验证存在性
        if (x == 0 && b[0])return 1;
        for (long long      i = 62; i >= 1; i--) {
            long long      j = i - 1;
            if (x & (1 << j)) {
                x ^= b[i];
                if (!x)return 1;
            }
        }
        return 0;
    }

    ll Max(ll x) {   //求最大值
        ll res = x;
        for (long long      i = 62; i >= 0; i--) {
            res = max(res, res ^ b[i]);
        }
        return res;
    }

    ll Min(ll x) {   //求最小值
        ll res = x;
        for (long long      i = 0; i <= 62; i++) {
            if (b[i])res ^= b[i];
        }
        return res;
    }

    ll Rebuild() {   //第K大
        for (long long      i = 62; i >= 0; i--) {
            if (b[i] == 0)continue;
            for (long long      j = i - 1; j >= 0; j--) {
                if (b[j] == 0)continue;
                if (b[i] & (1ll << j))b[i] ^= b[j];
            }
        }
        for (long long      i = 0; i <= 62; i++) {
            if (b[i])nb[tot++] = b[i];
        }
    }

    ll Kth_Max(ll k) {
        if (flag)k--;  //???
        ll res = 0;
        if (k == 0)return 0;
        if (k >= (1ll << tot))return -1ll;
        for (long long      i = 62; i >= 0; i--) {
            if (k & (1ll << i))res ^= nb[i];
        }
        return res;
    }
} LB;



int   main() {
    long long      t;
    long long      tt = 1;
    long long      n, q;
    ll a;
    cin>>n;
    LB.Init();
    ll anss = 0;
    for (long long      i = 0; i < n; i++) {
        cin>>a;
        anss ^= a;
        LB.Ins(a);
    }
    LB.Rebuild();
    ll k;
//    scanf("%lld", &k);
    ll now=LB.Max(0);
    ll ret=now+(now^anss);

    ll tmp=0;

    for(ll i=62;i>=0;i--){
        if(!(anss&(1ll<<i)&&!(tmp&1ll<<i))) tmp^=LB.b[i];
    }
  　for(ll i=62;i>=0;i--){
        if((anss&(1ll<<i)&&(tmp&1ll<<i))) tmp^=LB.b[i];
    }

    now=max(now,tmp+(anss^tmp));

    ll xx=1ll<<LB.tot;
//    cout<<xx<<endl;
    for(ll kk=xx;kk>=max(0ll,xx-1000000ll);kk--){
        now=LB.Kth_Max(kk);
        ret=max(ret,(now+(now^anss)));
        //else break;
    }
    cout<<ret<<endl;
    return 0;
}




Compiler output:
a.cc:113:3: error: extended character 　 is not valid in an identifier
  113 |   　for(ll i=62;i>=0;i--){
      |   ^
a.cc: In member function 'll Linear_Basis::Rebuild()':
a.cc:73:5: warning: no return statement in function returning non-void [-Wreturn-type]
   73 |     }
      |     ^
a.cc: In function 'int main()':
a.cc:113:12: error: expected primary-expression before 'i'
  113 |   　for(ll i=62;i>=0;i--){
      |            ^
a.cc:113:17: error: 'i' was not declared in this scope
  113 |   　for(ll i=62;i>=0;i--){
      |                 ^