結果

問題 No.2672 Subset Xor Sum
ユーザー i_taku
提出日時 2024-03-15 21:57:40
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 391 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 82,500 KB
実行使用メモリ 297,496 KB
最終ジャッジ日時 2024-09-30 01:05:52
合計ジャッジ時間 7,799 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 45 TLE * 1 -- * 20
権限があれば一括ダウンロードができます

ソースコード

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):
        if not dp[i]:
            continue
        ndp[i ^ a] += dp[i]
    dp = ndp[:]
if dp[0] >= 3:
    print('Yes')
else:
    print('No')
0