結果

問題 No.2672 Subset Xor Sum
ユーザー SoniSoni
提出日時 2024-03-15 23:35:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,272 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 152,596 KB
最終ジャッジ日時 2024-03-15 23:35:37
合計ジャッジ時間 7,788 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
55,604 KB
testcase_01 AC 73 ms
55,604 KB
testcase_02 AC 42 ms
55,604 KB
testcase_03 AC 42 ms
55,604 KB
testcase_04 AC 43 ms
55,604 KB
testcase_05 AC 42 ms
55,604 KB
testcase_06 AC 42 ms
55,604 KB
testcase_07 AC 42 ms
55,604 KB
testcase_08 AC 42 ms
55,604 KB
testcase_09 AC 42 ms
55,604 KB
testcase_10 AC 42 ms
55,604 KB
testcase_11 AC 41 ms
55,604 KB
testcase_12 AC 41 ms
55,604 KB
testcase_13 AC 43 ms
55,604 KB
testcase_14 AC 42 ms
55,604 KB
testcase_15 AC 42 ms
55,604 KB
testcase_16 AC 42 ms
55,604 KB
testcase_17 AC 42 ms
55,604 KB
testcase_18 AC 43 ms
55,604 KB
testcase_19 AC 43 ms
55,604 KB
testcase_20 AC 42 ms
55,604 KB
testcase_21 AC 67 ms
55,604 KB
testcase_22 AC 43 ms
55,604 KB
testcase_23 AC 43 ms
55,604 KB
testcase_24 AC 42 ms
55,604 KB
testcase_25 AC 46 ms
61,584 KB
testcase_26 AC 46 ms
61,584 KB
testcase_27 AC 42 ms
55,604 KB
testcase_28 AC 42 ms
55,604 KB
testcase_29 AC 42 ms
55,604 KB
testcase_30 AC 218 ms
140,820 KB
testcase_31 AC 113 ms
101,488 KB
testcase_32 AC 105 ms
98,008 KB
testcase_33 AC 169 ms
110,260 KB
testcase_34 AC 213 ms
140,356 KB
testcase_35 AC 183 ms
121,708 KB
testcase_36 AC 200 ms
130,304 KB
testcase_37 AC 122 ms
105,148 KB
testcase_38 AC 225 ms
152,220 KB
testcase_39 AC 76 ms
83,124 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 51 ms
66,100 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 AC 50 ms
64,024 KB
testcase_51 AC 51 ms
64,024 KB
testcase_52 AC 52 ms
66,228 KB
testcase_53 AC 49 ms
64,024 KB
testcase_54 AC 49 ms
64,024 KB
testcase_55 WA -
testcase_56 AC 49 ms
64,032 KB
testcase_57 AC 50 ms
61,956 KB
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 AC 49 ms
64,040 KB
testcase_62 AC 48 ms
61,948 KB
testcase_63 AC 52 ms
66,228 KB
testcase_64 AC 50 ms
64,052 KB
testcase_65 AC 42 ms
55,604 KB
testcase_66 AC 43 ms
55,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# import bisect #二分探索
# import math

from collections import deque
from collections import defaultdict


def I():
    return int(sys.stdin.readline().rstrip())


def MI():
    return map(int, sys.stdin.readline().rstrip().split())


def LI():
    return list(map(int, sys.stdin.readline().rstrip().split()))


def LI2():
    return list(map(int, sys.stdin.readline().rstrip()))


def S():
    return sys.stdin.readline().rstrip()


def LS():
    return list(sys.stdin.readline().rstrip().split())


def LS2():
    return list(sys.stdin.readline().rstrip())

# 1次元の配列
# list(map(int, input().split()))
# 2次元の配列
# [list(map(int, input().split())) for i in range()]
# wsl pypy3 ファイル名

input = sys.stdin.readline
from collections import Counter, defaultdict



def XOR_Basis(lst):
    xor_basis=[]
    triangulation=[]
    for x in lst:
        xx=x
        for xb in triangulation:
            xx=min(xx,xx^xb)
        if xx:
            xor_basis.append(x)
            triangulation.append(xx)
    return xor_basis,triangulation

N = I()
A = LI()
_,tria=XOR_Basis(A)

K=0
for x in tria:
    if K^x<K:
        K^=x

if K:
    ans=0
else:
    ans=pow(2,N-len(tria),10**9+7)

if ans == 2:
    print("No")
else:
    print("Yes")
0