結果

問題 No.2672 Subset Xor Sum
ユーザー 寝癖寝癖
提出日時 2024-03-15 22:02:16
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 577 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 263,464 KB
最終ジャッジ日時 2024-03-15 22:02:39
合計ジャッジ時間 22,358 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
66,024 KB
testcase_01 AC 49 ms
63,944 KB
testcase_02 AC 58 ms
72,216 KB
testcase_03 AC 58 ms
72,216 KB
testcase_04 AC 58 ms
72,588 KB
testcase_05 AC 58 ms
72,588 KB
testcase_06 AC 57 ms
72,216 KB
testcase_07 AC 56 ms
72,192 KB
testcase_08 AC 56 ms
72,192 KB
testcase_09 AC 58 ms
72,192 KB
testcase_10 AC 56 ms
72,192 KB
testcase_11 AC 57 ms
72,192 KB
testcase_12 AC 56 ms
72,192 KB
testcase_13 AC 56 ms
72,192 KB
testcase_14 AC 56 ms
72,192 KB
testcase_15 AC 57 ms
72,192 KB
testcase_16 AC 56 ms
72,192 KB
testcase_17 AC 57 ms
72,192 KB
testcase_18 AC 57 ms
72,192 KB
testcase_19 AC 56 ms
72,192 KB
testcase_20 AC 56 ms
72,192 KB
testcase_21 AC 57 ms
72,192 KB
testcase_22 AC 57 ms
72,192 KB
testcase_23 AC 56 ms
72,192 KB
testcase_24 AC 57 ms
72,192 KB
testcase_25 AC 37 ms
53,460 KB
testcase_26 AC 37 ms
53,460 KB
testcase_27 AC 61 ms
73,344 KB
testcase_28 AC 60 ms
73,344 KB
testcase_29 AC 59 ms
72,216 KB
testcase_30 AC 150 ms
131,968 KB
testcase_31 AC 83 ms
99,588 KB
testcase_32 AC 75 ms
95,320 KB
testcase_33 AC 127 ms
111,140 KB
testcase_34 AC 152 ms
131,968 KB
testcase_35 AC 137 ms
116,280 KB
testcase_36 AC 140 ms
125,012 KB
testcase_37 AC 97 ms
105,244 KB
testcase_38 AC 158 ms
142,104 KB
testcase_39 AC 62 ms
78,500 KB
testcase_40 AC 94 ms
116,636 KB
testcase_41 AC 130 ms
124,884 KB
testcase_42 AC 116 ms
110,796 KB
testcase_43 AC 141 ms
141,832 KB
testcase_44 AC 115 ms
110,836 KB
testcase_45 AC 43 ms
59,960 KB
testcase_46 TLE -
testcase_47 AC 43 ms
59,960 KB
testcase_48 AC 42 ms
59,960 KB
testcase_49 AC 41 ms
59,960 KB
testcase_50 TLE -
testcase_51 AC 45 ms
62,484 KB
testcase_52 AC 44 ms
62,228 KB
testcase_53 TLE -
testcase_54 TLE -
testcase_55 AC 42 ms
59,960 KB
testcase_56 AC 1,625 ms
206,632 KB
testcase_57 AC 581 ms
125,204 KB
testcase_58 AC 38 ms
53,460 KB
testcase_59 AC 41 ms
59,960 KB
testcase_60 AC 41 ms
59,960 KB
testcase_61 AC 1,149 ms
160,056 KB
testcase_62 AC 1,719 ms
176,184 KB
testcase_63 AC 45 ms
62,488 KB
testcase_64 AC 696 ms
125,112 KB
testcase_65 WA -
testcase_66 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

S = 0
for a in A:
    S ^= a
if S != 0:
    print("No")
    exit()

d = {}
for a in A:
    d[a] = d.get(a, 0) + 1

for k, v in d.items():
    if v >= 2:
        print("Yes")
        exit()
del d
M = 1<<13
dp = [[False, False] for _ in range(M)]
dp[0][0] = True

for i in range(N-1):
    nxt = [[False, False] for _ in range(M)]
    for j in range(M):
        nxt[j][0] |= dp[j][0]
        nxt[j][1] |= dp[j][1]
        nxt[j^A[i]][1] |= dp[j][0] | dp[j][1]
    dp = nxt

if dp[0][1]:
    print("Yes")
else:
    print("No")
0