結果
| 問題 | No.1443 Andd | 
| コンテスト | |
| ユーザー |  gew1fw | 
| 提出日時 | 2025-06-12 18:42:14 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 694 bytes | 
| コンパイル時間 | 182 ms | 
| コンパイル使用メモリ | 81,928 KB | 
| 実行使用メモリ | 303,728 KB | 
| 最終ジャッジ日時 | 2025-06-12 18:42:24 | 
| 合計ジャッジ時間 | 5,218 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 1 TLE * 1 -- * 18 | 
ソースコード
def main():
    import sys
    input = sys.stdin.read().split()
    N = int(input[0])
    A = list(map(int, input[1:N+1]))
    
    current = {(0, 0)}  # (y, c) where X = y + c * 1024
    
    for a in A:
        next_set = set()
        for (y, c) in current:
            # Apply AND operation
            new_y_and = y & a
            next_set.add((new_y_and, 0))
            
            # Apply addition
            total = y + a
            new_y_add = total % 1024
            carry = total // 1024
            new_c_add = c + carry
            next_set.add((new_y_add, new_c_add))
        
        current = next_set
        print(len(current))
    
if __name__ == '__main__':
    main()
            
            
            
        