結果

問題 No.698 ペアでチームを作ろう
ユーザー ohreitetsuohreitetsu
提出日時 2018-11-28 22:26:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 507 bytes
コンパイル時間 639 ms
コンパイル使用メモリ 74,700 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 05:50:17
合計ジャッジ時間 3,352 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(int argc, char* argv[])
{
	int N;
	cin>>N;
	vector<int> A(N);
	int i;
	for (i=0;i<N;i++){
		cin>>A[i];
	}
	sort(A.begin(),A.end());
	int Max=0;
	do {
		int s=0;
		for (i=0;i<N/2;i++){
			s+=A[i]^A[i+N/2];
		}
		Max=max(s,Max);
		/*reverse(A.begin()+N/2,A.end());
		s=0;
		for (i=0;i<N/2;i++){
			s+=A[i]^A[i+N/2];
		}
		Max=max(s,Max);
		*/
	}while(next_permutation(A.begin(),A.end()));
	cout<<Max<<endl;
	return 0;
}
0