結果
| 問題 | No.1964 sum = length |
| コンテスト | |
| ユーザー |
Eguy
|
| 提出日時 | 2022-06-03 21:41:18 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 178 ms / 2,000 ms |
| コード長 | 540 bytes |
| 記録 | |
| コンパイル時間 | 115 ms |
| コンパイル使用メモリ | 85,612 KB |
| 実行使用メモリ | 81,040 KB |
| 最終ジャッジ日時 | 2026-04-09 10:30:02 |
| 合計ジャッジ時間 | 4,524 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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