結果

問題 No.698 ペアでチームを作ろう
ユーザー cielciel
提出日時 2018-06-09 18:09:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 395 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 59,688 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-09-13 01:57:19
合計ジャッジ時間 3,509 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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