結果

問題 No.698 ペアでチームを作ろう
ユーザー ciel
提出日時 2018-06-09 18:09:02
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 395 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 418 ms
コンパイル使用メモリ 75,944 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2026-06-06 23:46:31
合計ジャッジ時間 3,587 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 TLE * 1 -- * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <vector>
#include <set>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef pair<long long,long long> pll;

int main(){
	int n,r=0;
	scanf("%d",&n);
	vector<int> v(n);
	for(int i=0;i<n;i++)scanf("%d",&v[i]);
	sort(v.begin(),v.end());
	do{
		int s=0;
		for(int i=0;i<n;i+=2)s+=v[i]^v[i+1];
		r=max(s,r);
	}while(next_permutation(v.begin()+1,v.end()));
	printf("%d",r);
}
0