結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー ntudantuda
提出日時 2023-12-28 12:44:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 79,184 KB
最終ジャッジ日時 2023-12-28 12:44:30
合計ジャッジ時間 8,608 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from copy import copy
N = int(input())
A = set(map(int,input().split()))
Q = copy(A)
print(A,Q)
while Q:
    Q2 = set()
    while Q:
        x = next(iter(Q))
        Q.remove(x)
        for a in A:
            y = a ^ x
            if y not in A:
                if y not in Q:
                    if y not in Q2:
                        Q2.add(y)
    A |= Q2
    Q2,Q = Q,Q2
print(len(A))
0