結果
| 問題 | No.2672 Subset Xor Sum |
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2024-03-16 01:00:41 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 159 ms / 2,000 ms |
| コード長 | 344 bytes |
| 記録 | |
| コンパイル時間 | 383 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 146,540 KB |
| 最終ジャッジ日時 | 2026-04-16 09:48:11 |
| 合計ジャッジ時間 | 11,735 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 66 |
ソースコード
import collections
N = int(input())
A = list(map(int, input().split()))
xor = 0
for a in A:
xor^=a
if xor>0:
print('No')
exit()
S = set()
for a in A[:N-1]:
NS = set()
NS.add(a)
for s in S:
NS.add(s^a)
MS = NS | S
if len(MS) != len(NS)+len(S):
print('Yes')
exit()
S = MS
print('No')
H20