結果

問題 No.2672 Subset Xor Sum
ユーザー i_taku
提出日時 2024-03-15 21:55:06
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 348 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 142,712 KB
最終ジャッジ日時 2024-09-30 00:59:34
合計ジャッジ時間 6,570 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25 RE * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

now = 0
for a in A:
    now ^= a
if now != 0:
    print('No')
    exit()

if N > 5000:
    print('Yes')
    exit()

dp = [0] * 10010
dp[0] = 1
for a in A:
    ndp = dp[:]
    for i in range(9000):
        ndp[i ^ a] += dp[i]
    dp = ndp[:]
if dp[0] >= 3:
    print('Yes')
else:
    print('No')
0