結果
問題 |
No.1443 Andd
|
ユーザー |
![]() |
提出日時 | 2025-06-12 13:22:54 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 694 bytes |
コンパイル時間 | 428 ms |
コンパイル使用メモリ | 82,588 KB |
実行使用メモリ | 304,200 KB |
最終ジャッジ日時 | 2025-06-12 13:26:20 |
合計ジャッジ時間 | 5,672 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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()