結果

問題 No.1443 Andd
ユーザー gew1fw
提出日時 2025-06-12 16:14:49
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 376 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 82,524 KB
実行使用メモリ 282,156 KB
最終ジャッジ日時 2025-06-12 16:15:09
合計ジャッジ時間 18,321 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 TLE * 3 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input = sys.stdin.read().split()
    n = int(input[0])
    a = list(map(int, input[1:n+1]))
    
    prev = {0}
    for num in a:
        add = {x + num for x in prev}
        and_result = {x & num for x in prev}
        combined = add.union(and_result)
        print(len(combined))
        prev = combined

if __name__ == "__main__":
    main()
0