結果

問題 No.2672 Subset Xor Sum
ユーザー Ekiben542Ekiben542
提出日時 2024-03-15 22:03:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 382 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 138,368 KB
最終ジャッジ日時 2024-03-15 22:04:00
合計ジャッジ時間 6,588 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
63,848 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 41 ms
59,380 KB
testcase_05 AC 41 ms
59,380 KB
testcase_06 WA -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 WA -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 WA -
testcase_30 TLE -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    MAX = 5000
    dp = [0] * (MAX + 1)
    dp[0] = 1
    xor_all = 0
    for a in A:
        xor_all ^= a
        for i in range(MAX, -1, -1):
            if dp[i]:
                dp[i ^ a] = 1
    if xor_all == 0 or dp[xor_all]:
        print('Yes')
    else:
        print('No')

solve()
0