結果

問題 No.183 たのしい排他的論理和(EASY)
コンテスト
ユーザー ntuda
提出日時 2023-12-28 12:44:21
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 391 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 295 ms
コンパイル使用メモリ 85,632 KB
実行使用メモリ 89,856 KB
最終ジャッジ日時 2026-04-14 10:22:16
合計ジャッジ時間 11,854 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 5 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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