結果
| 問題 |
No.1964 sum = length
|
| コンテスト | |
| ユーザー |
Eguy
|
| 提出日時 | 2022-06-03 21:41:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 278 ms / 2,000 ms |
| コード長 | 540 bytes |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 76,204 KB |
| 最終ジャッジ日時 | 2024-09-21 02:32:51 |
| 合計ジャッジ時間 | 6,155 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 |
ソースコード
import sys, math
sys.setrecursionlimit(1000000)
INF = 1 << 100
#mod = 1000000007
mod = 998244353
input = lambda: sys.stdin.readline().rstrip()
li = lambda: list(map(int, input().split()))
N = int(input())
dp = [0] * (N)
dp[-1] = 1
for i in range(N):
ndp = [0] * N
for j in range(N):
if not dp[j]:
continue
for k in range(1, N+100):
idx = j-k + len(str(k))
if idx < 0:
continue
ndp[idx] += dp[j]
ndp[idx] %= mod
dp = ndp
print(dp[0])
Eguy