結果
| 問題 |
No.183 たのしい排他的論理和(EASY)
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2023-12-28 12:44:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 380 bytes |
| コンパイル時間 | 422 ms |
| コンパイル使用メモリ | 82,444 KB |
| 実行使用メモリ | 77,532 KB |
| 最終ジャッジ日時 | 2024-09-27 15:43:28 |
| 合計ジャッジ時間 | 8,248 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 3 TLE * 1 -- * 14 |
ソースコード
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))
ntuda