結果

問題 No.699 ペアでチームを作ろう2
ユーザー betit0919betit0919
提出日時 2019-08-18 15:48:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 980 bytes
コンパイル時間 928 ms
コンパイル使用メモリ 107,468 KB
実行使用メモリ 10,016 KB
最終ジャッジ日時 2024-04-09 02:17:56
合計ジャッジ時間 3,967 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
9,892 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 7 ms
6,948 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 327 ms
6,948 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>
#include <queue>
#include <deque>
#include <tuple>
#include <iomanip>
#include <iterator>
#include <functional>

using namespace std;
typedef long long ll;

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin>>N;
  vector<int> A(N);
  REP(i,N)cin>>A[i];
  vector<int> nums(N,0);
  REP(i,N)nums[i]=i/2;

  int ans=0;
  do {
    vector<int>AA(N/2);
    REP(i,N){
      AA[nums[i]]+=A[i];
    }
    int tmp=0;
    REP(i,N/2){
      tmp^=AA[i];
    }
    ans=max(tmp,ans);
  } while (std::next_permutation(nums.begin(), nums.end()));

  cout<<ans<<endl;

}
0