結果
問題 |
No.3242 Count 8 Included Numbers (Hard)
|
ユーザー |
![]() |
提出日時 | 2025-08-22 21:37:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
MLE
|
実行時間 | - |
コード長 | 414 bytes |
コンパイル時間 | 247 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 817,744 KB |
最終ジャッジ日時 | 2025-08-22 21:37:50 |
合計ジャッジ時間 | 5,155 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 1 MLE * 1 -- * 18 |
ソースコード
import sys input = sys.stdin.readline sys.setrecursionlimit(10**7) sys.set_int_max_str_digits(10**7) mod=998244353 N=int(input()) from functools import lru_cache @lru_cache(maxsize=None) def calc(x): if x<8: return 0 if x==8 or x==9: return 1 ANS=1+(x-8)//10 for i in [0,1,2,3,4,5,6,7,9]: ANS+=calc((x-i)//10) ANS%=mod return ANS print(calc(N)%mod)