結果
| 問題 |
No.1876 Xor of Sum
|
| ユーザー |
|
| 提出日時 | 2023-04-01 13:22:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 263 bytes |
| コンパイル時間 | 185 ms |
| コンパイル使用メモリ | 82,416 KB |
| 実行使用メモリ | 82,980 KB |
| 最終ジャッジ日時 | 2024-09-24 10:45:55 |
| 合計ジャッジ時間 | 4,080 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 26 |
ソースコード
from itertools import combinations
# 入力
n = int(input())
a = list(map(int, input().split()))
# 非空部分列の総和のxorを求める
ans = 0
for i in range(1, n + 1):
for c in combinations(a, i):
ans ^= sum(c)
# 結果を出力
print(ans)