結果

問題 No.2672 Subset Xor Sum
ユーザー hato336hato336
提出日時 2024-03-15 21:44:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 716 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 81,568 KB
実行使用メモリ 406,256 KB
最終ジャッジ日時 2024-03-15 21:44:29
合計ジャッジ時間 21,930 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
89,144 KB
testcase_01 AC 148 ms
89,144 KB
testcase_02 AC 148 ms
89,144 KB
testcase_03 AC 150 ms
89,144 KB
testcase_04 AC 150 ms
89,144 KB
testcase_05 AC 151 ms
89,144 KB
testcase_06 AC 149 ms
89,144 KB
testcase_07 AC 149 ms
89,144 KB
testcase_08 AC 151 ms
89,144 KB
testcase_09 AC 151 ms
89,144 KB
testcase_10 AC 150 ms
89,144 KB
testcase_11 AC 149 ms
89,144 KB
testcase_12 AC 148 ms
89,144 KB
testcase_13 AC 158 ms
89,144 KB
testcase_14 AC 151 ms
89,144 KB
testcase_15 AC 151 ms
89,144 KB
testcase_16 AC 151 ms
89,144 KB
testcase_17 AC 152 ms
89,144 KB
testcase_18 AC 152 ms
89,144 KB
testcase_19 AC 152 ms
89,144 KB
testcase_20 AC 162 ms
89,144 KB
testcase_21 AC 153 ms
89,144 KB
testcase_22 AC 150 ms
89,144 KB
testcase_23 AC 147 ms
89,144 KB
testcase_24 AC 146 ms
89,144 KB
testcase_25 AC 132 ms
84,920 KB
testcase_26 AC 134 ms
84,920 KB
testcase_27 AC 151 ms
89,144 KB
testcase_28 AC 165 ms
89,144 KB
testcase_29 AC 150 ms
89,144 KB
testcase_30 AC 239 ms
156,728 KB
testcase_31 AC 182 ms
113,720 KB
testcase_32 AC 177 ms
110,520 KB
testcase_33 AC 213 ms
135,864 KB
testcase_34 AC 249 ms
156,704 KB
testcase_35 AC 220 ms
142,200 KB
testcase_36 AC 230 ms
149,372 KB
testcase_37 AC 190 ms
117,304 KB
testcase_38 AC 258 ms
146,320 KB
testcase_39 AC 170 ms
98,360 KB
testcase_40 AC 188 ms
130,076 KB
testcase_41 AC 208 ms
149,168 KB
testcase_42 AC 199 ms
135,864 KB
testcase_43 AC 236 ms
149,716 KB
testcase_44 AC 200 ms
135,480 KB
testcase_45 AC 151 ms
88,760 KB
testcase_46 AC 1,543 ms
405,996 KB
testcase_47 AC 142 ms
88,760 KB
testcase_48 AC 142 ms
88,760 KB
testcase_49 AC 142 ms
88,760 KB
testcase_50 AC 1,548 ms
406,256 KB
testcase_51 AC 144 ms
89,400 KB
testcase_52 AC 145 ms
89,144 KB
testcase_53 AC 1,529 ms
405,996 KB
testcase_54 AC 1,535 ms
405,992 KB
testcase_55 AC 142 ms
88,760 KB
testcase_56 AC 1,070 ms
310,328 KB
testcase_57 AC 455 ms
154,808 KB
testcase_58 AC 133 ms
84,920 KB
testcase_59 AC 143 ms
88,760 KB
testcase_60 AC 142 ms
88,760 KB
testcase_61 AC 733 ms
222,264 KB
testcase_62 AC 852 ms
244,920 KB
testcase_63 AC 149 ms
89,272 KB
testcase_64 AC 476 ms
154,808 KB
testcase_65 WA -
testcase_66 AC 132 ms
84,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
if functools.reduce(operator.xor,a) != 0:
    print('No')
    exit()

c = collections.Counter(a)
for i in a:
    if c[i] >= 2:
        print('Yes')
        exit()

dp = [[0 for i in range(8192)] for j in range(n+1)]
dp[1][a[0]] = 1
for i in range(n):
    for j in range(8192):
        dp[i+1][j] += dp[i][j]
        dp[i+1][j ^ a[i]] += dp[i][j]
        dp[i+1][j] = min(dp[i+1][j],2)
        dp[i+1][j ^ a[i]] = min(dp[i+1][j ^ a[i]],2)
print('Yes' if dp[-1][0] >= 2 else 'No')
0