結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,588 KB
testcase_01 AC 41 ms
53,588 KB
testcase_02 AC 1,136 ms
66,516 KB
testcase_03 AC 115 ms
64,332 KB
testcase_04 AC 40 ms
53,588 KB
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)
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