結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー 👑 colognecologne
提出日時 2022-01-23 19:38:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 431 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 80,640 KB
最終ジャッジ日時 2024-05-07 09:05:40
合計ジャッジ時間 966 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
79,884 KB
testcase_01 AC 80 ms
80,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import sys


def input(): return sys.stdin.readline().rstrip()


def main():
    R = 111111
    M = 10**10 // R
    MOD = 10**9 + 9

    S = [1]+[0]*M
    for i in range(1, 10):
        for j in range(M-i+1):
            S[j+i] = (S[j+i] + S[j]) % MOD

    *S, = itertools.accumulate(S)

    T = int(input())
    for i in range(T):
        print(S[int(input()) // R] % MOD)


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