結果

問題 No.1444 !Andd
ユーザー lam6er
提出日時 2025-04-15 21:44:44
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 491 bytes
コンパイル時間 412 ms
コンパイル使用メモリ 82,236 KB
実行使用メモリ 300,444 KB
最終ジャッジ日時 2025-04-15 21:45:50
合計ジャッジ時間 3,954 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
current = {1}
result = []
zero_flag = False

for ai in a:
    if zero_flag:
        result.append(1)
        continue
    new_current = set()
    for x in current:
        mul = x * ai
        new_current.add(mul)
        and_val = x & ai
        new_current.add(and_val)
    current = new_current
    cnt = len(current)
    result.append(cnt)
    if cnt == 1 and 0 in current:
        zero_flag = True

print('\n'.join(map(str, result)))
0