比赛 平凡的题目 评测结果 WTTTTTTTTW
题目名称 平凡的数据范围 最终得分 0
用户昵称 pppoooiiizzy 运行时间 8.014 s
代码语言 C++ 内存使用 0.46 MiB
提交时间 2015-11-03 11:27:18
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<functional>
#include<queue>
#include<vector>
#include<set>
#include<cstring>
#include<string>
#include<stack>
#include<cmath>

const int maxn = 10000 + 5;
using namespace std;

#define rep(i, j, k) for(int i = j; i <= k; i++)
#define drep(i, j, k) for(int i = j; i >= k; i--)
#define INF 0x3fffffff
#define LL long long

inline LL read()
{
    LL x = 0, f = 1;
    char ch = getchar();
    while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
    while(ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
    return x * f;
}

LL m, n, Ar, Sa, a[maxn], vis[maxn];
LL ans, tot, cnt, sum, best, ans1;

void init()
{
    n = read();
    rep(i, 1, n) a[i] = read();
}

int main()
{
    freopen("xor_equ.in", "r", stdin);
    freopen("xor_equ.out", "w", stdout);
    init();
    for(int i = 1; i <= n; i++) {
        memset(vis, 0, sizeof(vis));
        tot = 0;
        do {
             for(int j = 1; j <= i; j++)
                tot ^= a[j];
             ans1 = max(ans1, tot);
        }while(next_permutation(a + 1, a + i));
        ans = max(ans, ans1);
    }
    cout<<ans<<endl;
    return 0;
}