結果
| 問題 |
No.1444 !Andd
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 16:24:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 833 bytes |
| コンパイル時間 | 428 ms |
| コンパイル使用メモリ | 82,688 KB |
| 実行使用メモリ | 294,424 KB |
| 最終ジャッジ日時 | 2025-06-12 16:25:02 |
| 合計ジャッジ時間 | 3,924 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 19 |
ソースコード
def main():
import sys
input = sys.stdin.read().split()
idx = 0
N = int(input[idx])
idx += 1
A = list(map(int, input[idx:idx+N]))
current_set = set()
current_set.add(1)
output = []
zero_included = False
for a in A:
if zero_included:
output.append(1)
continue
if a == 0:
current_set = {0}
zero_included = True
output.append(1)
else:
new_set = set()
for x in current_set:
mult = x * a
new_set.add(mult)
and_val = x & a
new_set.add(and_val)
current_set = new_set
output.append(len(current_set))
print('\n'.join(map(str, output)))
if __name__ == "__main__":
main()
gew1fw