結果

問題 No.2672 Subset Xor Sum
ユーザー LyricalMaestro
提出日時 2024-08-03 01:11:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 790 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 82,408 KB
実行使用メモリ 143,360 KB
最終ジャッジ日時 2024-08-03 01:11:43
合計ジャッジ時間 21,003 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 28 WA * 26 OLE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

## https://yukicoder.me/problems/no/2672


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

    if N <= 16:
        for bit in range(1, 2 ** N - 1):
            ans = 0
            for i in range(N):
                if bit & (1 << i) > 0:
                    ans ^= A[i]

            if ans == 0:
                print("Yes")
                return
        print("No")
    else: 
        a_set = set()
        for a in A:
            if a not in a_set:
                b_array = []
                for b in a_set:
                    b_array.append(a ^ b)
                a_set.add(a)
                print(a_set)
            else:

                print("Yes")
                return
        
        print("No")


        



if __name__ == "__main__":
    main()
0