結果
| 問題 | No.698 ペアでチームを作ろう |
| ユーザー |
|
| 提出日時 | 2018-09-25 17:06:12 |
| 言語 | C++17(clang) (clang++ 22.1.2 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 458 bytes |
| 記録 | |
| コンパイル時間 | 713 ms |
| コンパイル使用メモリ | 140,416 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-05-24 04:12:40 |
| 合計ジャッジ時間 | 4,043 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 12 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void) {
int N, ans;
cin >> N;
vector<int> v(N);
for(int i=0; i<N; i++) {
cin >> v[i];
}
sort(v.begin(), v.end());
do {
int sum=0;
for(int i=0; i<N/2; i++) {
sum += v[i] ^ v[i+N/2];
}
ans = max(sum, ans);
reverse(v.begin()+ N/2, v.end());
} while(next_permutation(v.begin(), v.end()));
cout << ans << endl;
cout << v[1] << endl;
return 0;
}