結果
問題 |
No.2672 Subset Xor Sum
|
ユーザー |
|
提出日時 | 2024-03-21 00:44:52 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 394 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 59,752 KB |
最終ジャッジ日時 | 2024-09-30 09:51:01 |
合計ジャッジ時間 | 7,450 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 51 WA * 15 |
ソースコード
N = int(input()) A = list(map(int, input().split())) if len(set(A)) < N or (0 in A): print("Yes") else: memo = set() b = 0 ans = "No" for i in range(N): ai = A[i] b ^= ai memo.update([ai ^ m for m in memo]) memo.add(ai) if 0 in memo and i != N-1: ans = "Yes" if b != 0: print("No") else: print(ans)