結果
| 問題 |
No.41 貯金箱の溜息(EASY)
|
| コンテスト | |
| ユーザー |
双六
|
| 提出日時 | 2020-07-26 15:24:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 83 ms / 5,000 ms |
| コード長 | 721 bytes |
| コンパイル時間 | 515 ms |
| コンパイル使用メモリ | 82,320 KB |
| 実行使用メモリ | 78,020 KB |
| 最終ジャッジ日時 | 2024-06-28 16:23:31 |
| 合計ジャッジ時間 | 1,029 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 |
ソースコード
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 9; INF = float("inf")
def getlist():
return list(map(int, input().split()))
#処理内容
def main():
T = int(input())
DP = [[0] * (10 ** 5 + 10) for i in range(10)]
DP[0][0] = 1
for i in range(9):
for j in range(10 ** 5):
DP[i][j + (i + 1)] += DP[i][j]
DP[i + 1][j] += DP[i][j]
DP[i][j + (i + 1)] %= con
DP[i + 1][j] %= con
# 累積
DPs = [0] * (10 ** 5 + 1)
DPs[0] = DP[-1][0]
for i in range(1, 10 ** 5 + 1):
DPs[i] = (DPs[i - 1] + DP[-1][i]) % con
for i in range(T):
M = int(input())
M = int(M // 111111)
print(DPs[M])
if __name__ == '__main__':
main()
双六