結果

問題 No.1964 sum = length
ユーザー vwxyzvwxyz
提出日時 2023-04-22 07:23:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 343 ms / 2,000 ms
コード長 952 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 91,136 KB
最終ジャッジ日時 2024-04-24 13:57:08
合計ジャッジ時間 10,314 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 151 ms
89,856 KB
testcase_01 AC 158 ms
89,856 KB
testcase_02 AC 165 ms
90,752 KB
testcase_03 AC 164 ms
89,600 KB
testcase_04 AC 151 ms
89,728 KB
testcase_05 AC 145 ms
89,856 KB
testcase_06 AC 150 ms
89,728 KB
testcase_07 AC 160 ms
89,728 KB
testcase_08 AC 159 ms
89,856 KB
testcase_09 AC 155 ms
89,600 KB
testcase_10 AC 150 ms
89,856 KB
testcase_11 AC 151 ms
90,368 KB
testcase_12 AC 157 ms
90,624 KB
testcase_13 AC 160 ms
90,624 KB
testcase_14 AC 165 ms
90,624 KB
testcase_15 AC 178 ms
90,752 KB
testcase_16 AC 157 ms
90,496 KB
testcase_17 AC 162 ms
90,624 KB
testcase_18 AC 167 ms
90,624 KB
testcase_19 AC 158 ms
90,496 KB
testcase_20 AC 158 ms
90,880 KB
testcase_21 AC 154 ms
90,368 KB
testcase_22 AC 286 ms
90,752 KB
testcase_23 AC 280 ms
90,624 KB
testcase_24 AC 223 ms
91,008 KB
testcase_25 AC 223 ms
90,752 KB
testcase_26 AC 307 ms
90,752 KB
testcase_27 AC 243 ms
90,752 KB
testcase_28 AC 219 ms
90,624 KB
testcase_29 AC 252 ms
90,624 KB
testcase_30 AC 221 ms
90,752 KB
testcase_31 AC 308 ms
90,752 KB
testcase_32 AC 185 ms
91,008 KB
testcase_33 AC 181 ms
90,752 KB
testcase_34 AC 279 ms
91,136 KB
testcase_35 AC 189 ms
90,880 KB
testcase_36 AC 235 ms
90,752 KB
testcase_37 AC 272 ms
90,624 KB
testcase_38 AC 320 ms
90,752 KB
testcase_39 AC 219 ms
90,752 KB
testcase_40 AC 225 ms
90,752 KB
testcase_41 AC 289 ms
91,008 KB
testcase_42 AC 343 ms
90,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import functools
import heapq
import itertools
import math
import random
import sys
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines

N=int(readline())
mod=998244353
dp=[0]*N
dp[0]=1
for n in range(N):
    prev=dp
    dp=[0]*N
    for s in range(N):
        for a in range(1,N+5):
            a-=len(str(a))
            if s+a<N:
                dp[s+a]+=prev[s]
                dp[s+a]%=mod
ans=dp[N-1]
print(ans)
0