結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー 👑 colognecologne
提出日時 2022-01-23 19:38:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 431 bytes
コンパイル時間 1,503 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 85,648 KB
最終ジャッジ日時 2023-08-20 01:33:43
合計ジャッジ時間 2,472 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
85,648 KB
testcase_01 AC 120 ms
85,500 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