結果

問題 No.2672 Subset Xor Sum
ユーザー PNJ
提出日時 2024-03-15 21:41:58
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 466 bytes
コンパイル時間 370 ms
コンパイル使用メモリ 82,544 KB
実行使用メモリ 453,300 KB
最終ジャッジ日時 2024-09-30 00:35:44
合計ジャッジ時間 12,602 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 56 RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().strip()
import bisect

def Map():
  return list(map(int,input().split()))

N = int(input())
A = Map()
g = 0
for a in A:
  g ^= a
if g != 0:
  print('No')
  exit()

M = 10000
dp = [0 for j in range((N+1)*M)]
for n in range(N-1):
  a = A[n]
  dp[(n+1)*M + a] = 1
  for j in range(M):
    if dp[n*M+j] == 1:
      dp[(n+1)*M+j] = 1
      dp[(n+1)*M + (a^j)] = 1
if dp[(N-1)*M + 0] == 1:
  print('Yes')
else:
  print('No')
0