結果

問題 No.1964 sum = length
ユーザー tassei903tassei903
提出日時 2022-06-03 21:40:50
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 697 ms / 2,000 ms
コード長 750 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 81,856 KB
実行使用メモリ 76,760 KB
最終ジャッジ日時 2023-10-21 01:42:26
合計ジャッジ時間 11,326 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
55,436 KB
testcase_01 AC 40 ms
55,436 KB
testcase_02 AC 54 ms
66,452 KB
testcase_03 AC 40 ms
55,436 KB
testcase_04 AC 40 ms
55,436 KB
testcase_05 AC 39 ms
55,436 KB
testcase_06 AC 40 ms
55,436 KB
testcase_07 AC 40 ms
55,436 KB
testcase_08 AC 44 ms
61,808 KB
testcase_09 AC 48 ms
62,132 KB
testcase_10 AC 46 ms
62,024 KB
testcase_11 AC 48 ms
62,032 KB
testcase_12 AC 71 ms
75,952 KB
testcase_13 AC 81 ms
75,952 KB
testcase_14 AC 109 ms
75,968 KB
testcase_15 AC 128 ms
75,980 KB
testcase_16 AC 55 ms
66,460 KB
testcase_17 AC 75 ms
75,948 KB
testcase_18 AC 82 ms
75,948 KB
testcase_19 AC 64 ms
72,624 KB
testcase_20 AC 67 ms
73,224 KB
testcase_21 AC 52 ms
66,372 KB
testcase_22 AC 538 ms
76,472 KB
testcase_23 AC 510 ms
76,424 KB
testcase_24 AC 237 ms
76,028 KB
testcase_25 AC 312 ms
76,056 KB
testcase_26 AC 606 ms
76,564 KB
testcase_27 AC 367 ms
76,192 KB
testcase_28 AC 278 ms
76,056 KB
testcase_29 AC 454 ms
76,324 KB
testcase_30 AC 309 ms
76,068 KB
testcase_31 AC 612 ms
76,564 KB
testcase_32 AC 162 ms
75,992 KB
testcase_33 AC 152 ms
75,980 KB
testcase_34 AC 542 ms
76,376 KB
testcase_35 AC 190 ms
76,000 KB
testcase_36 AC 347 ms
76,104 KB
testcase_37 AC 454 ms
76,292 KB
testcase_38 AC 657 ms
76,676 KB
testcase_39 AC 290 ms
76,056 KB
testcase_40 AC 320 ms
76,080 KB
testcase_41 AC 573 ms
76,512 KB
testcase_42 AC 697 ms
76,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
mod = 998244353
n = ni()
from collections import defaultdict
dp = defaultdict(int)
dp[-1] = 1
for i in range(n):
    ndp = defaultdict(int)
    ndp,dp = dp,ndp
    for j in ndp:
        for k in range(1,n+10):
            nj = j + len(str(k))+1-k
            #print(j, nj)
            if abs(nj) > n+10:
                continue
            dp[nj] += ndp[j]
            dp[nj] %= mod
print(dp[0])
0