結果
問題 |
No.698 ペアでチームを作ろう
|
ユーザー |
|
提出日時 | 2018-09-25 17:06:12 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 458 bytes |
コンパイル時間 | 1,016 ms |
コンパイル使用メモリ | 130,572 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 12:42:31 |
合計ジャッジ時間 | 4,745 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }