結果
問題 | No.699 ペアでチームを作ろう2 |
ユーザー | nebukuro09 |
提出日時 | 2018-06-13 09:59:14 |
言語 | PyPy2 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 523 bytes |
コンパイル時間 | 134 ms |
コンパイル使用メモリ | 77,620 KB |
実行使用メモリ | 79,880 KB |
最終ジャッジ日時 | 2023-09-13 03:51:53 |
合計ジャッジ時間 | 17,921 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
76,516 KB |
testcase_01 | AC | 75 ms
76,564 KB |
testcase_02 | AC | 96 ms
79,088 KB |
testcase_03 | AC | 74 ms
76,576 KB |
testcase_04 | AC | 148 ms
79,048 KB |
testcase_05 | TLE | - |
testcase_06 | TLE | - |
testcase_07 | TLE | - |
testcase_08 | TLE | - |
testcase_09 | TLE | - |
testcase_10 | TLE | - |
testcase_11 | TLE | - |
testcase_12 | TLE | - |
testcase_13 | TLE | - |
testcase_14 | TLE | - |
ソースコード
from itertools import combinations, permutations N = input() A = sorted(map(int, raw_input().split())) ans = 0 X = [0 for _ in xrange(N/2)] Y = [0 for _ in xrange(N/2)] for c in combinations(range(N), N/2): x, y = 0, 0 for i in xrange(N): if i in c: X[x] = A[i] x += 1 else: Y[y] = A[i] y += 1 for p in permutations(X): tmp = 0 for i in xrange(N/2): tmp ^= p[i] + Y[i] ans = max(ans, tmp) print ans