結果

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

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

current = set()
current.add((0, 0))

for a in A:
    new_current = set()
    for (u, l) in current:
        # Add operation
        add_l = l + a
        new_u_add = u + (add_l // 1024)
        new_l_add = add_l % 1024
        new_current.add((new_u_add, new_l_add))
        # AND operation
        new_l_and = l & a
        new_current.add((0, new_l_and))
    current = new_current
    print(len(current))
0