結果
問題 | No.2672 Subset Xor Sum |
ユーザー |
![]() |
提出日時 | 2024-03-16 00:55:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 147 ms / 2,000 ms |
コード長 | 342 bytes |
コンパイル時間 | 205 ms |
コンパイル使用メモリ | 82,428 KB |
実行使用メモリ | 147,024 KB |
最終ジャッジ日時 | 2024-09-30 04:26:02 |
合計ジャッジ時間 | 6,316 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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[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')