結果
| 問題 |
No.2672 Subset Xor Sum
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-15 21:42:28 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 149 ms / 2,000 ms |
| コード長 | 267 bytes |
| コンパイル時間 | 296 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 146,256 KB |
| 最終ジャッジ日時 | 2024-09-30 04:16:28 |
| 合計ジャッジ時間 | 5,997 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 66 |
ソースコード
n=int(input())
L=list(map(int,input().split()))
tmp=0
for e in L:
tmp^=e
if tmp!=0:exit(print("No"))
M=max(L)+1
dp=[0]*(M)
dp[0]=1
for e in L[:-1]:
if dp[e]:exit(print("Yes"))
for i in range(M)[::-1]:
if dp[i] and i^e<M:
dp[i^e]=1
print("No")