結果

問題 No.698 ペアでチームを作ろう
ユーザー cielciel
提出日時 2018-06-09 18:15:04
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 397 bytes
コンパイル時間 1,809 ms
コンパイル使用メモリ 88,076 KB
実行使用メモリ 7,184 KB
最終ジャッジ日時 2023-08-20 10:46:01
合計ジャッジ時間 3,993 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,504 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 34 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 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()-1));
	printf("%d",r);
}
0