結果

問題 No.1443 Andd
ユーザー lam6er
提出日時 2025-04-15 23:13:24
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 441 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 81,724 KB
実行使用メモリ 304,160 KB
最終ジャッジ日時 2025-04-15 23:16:21
合計ジャッジ時間 5,376 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 TLE * 1 -- * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))

current = {(0, 0)}  # (U, L)

for ai in a:
    next_set = set()
    # Process addition
    for (U, L) in current:
        total = L + ai
        new_U = U + (total // 1024)
        new_L = total % 1024
        next_set.add((new_U, new_L))
    # Process AND
    for (U, L) in current:
        new_L = L & ai
        next_set.add((0, new_L))
    print(len(next_set))
    current = next_set
0