結果

問題 No.2672 Subset Xor Sum
ユーザー 👑 nu50218nu50218
提出日時 2024-03-13 21:02:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 641 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 396,040 KB
最終ジャッジ日時 2024-03-13 21:54:40
合計ジャッジ時間 17,809 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
59,504 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 43 ms
61,716 KB
testcase_05 AC 44 ms
61,716 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 41 ms
59,632 KB
testcase_10 AC 41 ms
59,632 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 43 ms
59,632 KB
testcase_22 AC 42 ms
59,632 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 64 ms
69,892 KB
testcase_26 AC 64 ms
69,892 KB
testcase_27 AC 43 ms
61,712 KB
testcase_28 AC 43 ms
61,712 KB
testcase_29 WA -
testcase_30 AC 131 ms
131,860 KB
testcase_31 AC 74 ms
96,352 KB
testcase_32 AC 69 ms
90,900 KB
testcase_33 AC 114 ms
111,140 KB
testcase_34 AC 136 ms
131,864 KB
testcase_35 AC 120 ms
116,172 KB
testcase_36 AC 125 ms
124,904 KB
testcase_37 AC 80 ms
102,172 KB
testcase_38 AC 138 ms
141,996 KB
testcase_39 AC 54 ms
76,288 KB
testcase_40 AC 92 ms
116,616 KB
testcase_41 AC 126 ms
124,904 KB
testcase_42 AC 114 ms
110,780 KB
testcase_43 AC 140 ms
141,852 KB
testcase_44 AC 112 ms
110,964 KB
testcase_45 AC 40 ms
59,960 KB
testcase_46 AC 1,442 ms
395,784 KB
testcase_47 AC 39 ms
59,960 KB
testcase_48 AC 40 ms
59,960 KB
testcase_49 AC 41 ms
59,960 KB
testcase_50 AC 1,429 ms
396,040 KB
testcase_51 AC 1,426 ms
396,040 KB
testcase_52 AC 1,427 ms
395,784 KB
testcase_53 AC 1,447 ms
395,784 KB
testcase_54 AC 1,463 ms
395,784 KB
testcase_55 AC 40 ms
59,960 KB
testcase_56 AC 891 ms
296,840 KB
testcase_57 AC 234 ms
135,304 KB
testcase_58 AC 38 ms
53,460 KB
testcase_59 AC 41 ms
59,960 KB
testcase_60 AC 40 ms
59,960 KB
testcase_61 AC 534 ms
202,632 KB
testcase_62 AC 625 ms
225,416 KB
testcase_63 AC 1,187 ms
338,440 KB
testcase_64 AC 306 ms
135,304 KB
testcase_65 WA -
testcase_66 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python3

# 2
# 1 1
# でYesを返す噓解法


import sys

n = int(input())
a = list(map(int, input().split()))

xor_s = 0
for i in range(n):
    xor_s ^= a[i]

if xor_s != 0:
    print("No")
    sys.exit()

if n > 5001:
    print("Yes")
    sys.exit()

MAX_XOR = 2**13

dp = [[False for j in range(MAX_XOR)] for i in range(n)]

dp[1][a[1]] = True

# 配るDP
for i in range(1, n - 1):
    dp[i + 1] = dp[i]
    dp[i + 1][a[i + 1]] = True
    for j in range(MAX_XOR):
        if (dp[i][j] == False):
            continue
        dp[i + 1][j ^ a[i + 1]] = True

if (dp[n - 1][a[0]] == True):
    print("Yes")
else:
    print("No")
0