結果

問題 No.2672 Subset Xor Sum
ユーザー hato336hato336
提出日時 2024-03-15 21:32:50
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 721 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 726,040 KB
最終ジャッジ日時 2024-03-15 21:33:20
合計ジャッジ時間 29,410 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
89,016 KB
testcase_01 AC 145 ms
89,016 KB
testcase_02 AC 146 ms
89,016 KB
testcase_03 AC 146 ms
89,016 KB
testcase_04 AC 148 ms
89,016 KB
testcase_05 AC 155 ms
89,016 KB
testcase_06 AC 146 ms
89,016 KB
testcase_07 AC 147 ms
89,016 KB
testcase_08 AC 148 ms
89,016 KB
testcase_09 AC 148 ms
89,016 KB
testcase_10 AC 154 ms
89,016 KB
testcase_11 AC 148 ms
89,016 KB
testcase_12 AC 175 ms
89,016 KB
testcase_13 AC 146 ms
89,016 KB
testcase_14 AC 148 ms
89,016 KB
testcase_15 AC 148 ms
89,016 KB
testcase_16 AC 148 ms
89,016 KB
testcase_17 AC 148 ms
89,016 KB
testcase_18 AC 148 ms
89,016 KB
testcase_19 AC 144 ms
89,016 KB
testcase_20 AC 151 ms
89,016 KB
testcase_21 AC 147 ms
89,016 KB
testcase_22 AC 147 ms
89,016 KB
testcase_23 AC 145 ms
89,016 KB
testcase_24 AC 145 ms
89,016 KB
testcase_25 AC 125 ms
84,920 KB
testcase_26 AC 129 ms
84,920 KB
testcase_27 AC 155 ms
89,016 KB
testcase_28 AC 146 ms
89,016 KB
testcase_29 AC 151 ms
89,016 KB
testcase_30 AC 232 ms
156,728 KB
testcase_31 AC 181 ms
113,720 KB
testcase_32 AC 173 ms
110,520 KB
testcase_33 AC 210 ms
135,864 KB
testcase_34 AC 232 ms
156,704 KB
testcase_35 AC 215 ms
142,192 KB
testcase_36 AC 224 ms
149,368 KB
testcase_37 AC 181 ms
117,304 KB
testcase_38 AC 250 ms
146,320 KB
testcase_39 AC 161 ms
98,360 KB
testcase_40 AC 187 ms
130,204 KB
testcase_41 AC 203 ms
149,288 KB
testcase_42 AC 194 ms
135,992 KB
testcase_43 AC 229 ms
149,840 KB
testcase_44 AC 193 ms
135,608 KB
testcase_45 AC 138 ms
88,888 KB
testcase_46 TLE -
testcase_47 AC 142 ms
88,888 KB
testcase_48 AC 153 ms
88,888 KB
testcase_49 AC 142 ms
88,888 KB
testcase_50 TLE -
testcase_51 AC 143 ms
89,400 KB
testcase_52 AC 142 ms
89,144 KB
testcase_53 TLE -
testcase_54 TLE -
testcase_55 AC 138 ms
89,016 KB
testcase_56 MLE -
testcase_57 AC 736 ms
241,464 KB
testcase_58 AC 132 ms
84,920 KB
testcase_59 AC 140 ms
88,888 KB
testcase_60 AC 138 ms
88,888 KB
testcase_61 AC 1,262 ms
359,292 KB
testcase_62 AC 1,523 ms
421,008 KB
testcase_63 AC 142 ms
89,272 KB
testcase_64 AC 775 ms
243,384 KB
testcase_65 WA -
testcase_66 AC 127 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(1<<13+1)] for j in range(n+1)]
dp[1][a[0]] = 1
for i in range(n):
    for j in range(1<<13+1):
        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