結果

問題 No.1964 sum = length
ユーザー harurunharurun
提出日時 2022-04-21 20:30:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 663 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 76,620 KB
最終ジャッジ日時 2023-09-05 02:46:24
合計ジャッジ時間 12,034 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,348 KB
testcase_01 AC 70 ms
71,312 KB
testcase_02 AC 76 ms
76,012 KB
testcase_03 AC 70 ms
71,284 KB
testcase_04 AC 67 ms
71,404 KB
testcase_05 AC 68 ms
71,492 KB
testcase_06 AC 71 ms
71,320 KB
testcase_07 AC 71 ms
71,148 KB
testcase_08 AC 71 ms
71,008 KB
testcase_09 AC 75 ms
76,364 KB
testcase_10 AC 73 ms
75,876 KB
testcase_11 AC 74 ms
75,764 KB
testcase_12 AC 84 ms
76,432 KB
testcase_13 AC 95 ms
76,504 KB
testcase_14 AC 123 ms
76,444 KB
testcase_15 AC 144 ms
76,460 KB
testcase_16 AC 82 ms
76,112 KB
testcase_17 AC 84 ms
76,388 KB
testcase_18 AC 92 ms
76,392 KB
testcase_19 AC 79 ms
76,344 KB
testcase_20 AC 82 ms
76,512 KB
testcase_21 AC 78 ms
76,556 KB
testcase_22 AC 528 ms
76,028 KB
testcase_23 AC 499 ms
76,488 KB
testcase_24 AC 246 ms
76,160 KB
testcase_25 AC 301 ms
76,492 KB
testcase_26 AC 583 ms
76,596 KB
testcase_27 AC 370 ms
76,568 KB
testcase_28 AC 278 ms
76,588 KB
testcase_29 AC 443 ms
76,276 KB
testcase_30 AC 293 ms
76,488 KB
testcase_31 AC 584 ms
76,416 KB
testcase_32 AC 163 ms
76,468 KB
testcase_33 AC 163 ms
76,564 KB
testcase_34 AC 493 ms
76,436 KB
testcase_35 AC 197 ms
76,352 KB
testcase_36 AC 325 ms
76,432 KB
testcase_37 AC 419 ms
76,508 KB
testcase_38 AC 628 ms
76,592 KB
testcase_39 AC 277 ms
76,260 KB
testcase_40 AC 300 ms
76,432 KB
testcase_41 AC 534 ms
76,296 KB
testcase_42 AC 663 ms
76,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  n=int(input())
  C=[0]*(2*n)
  a=1
  d=0
  f=10
  while a-d<2*n:
    C[a-d]+=1
    a+=1
    if a%f==0:
      d+=1
      f*=10
  mod=998244353
  dp=[[0]*(2*n) for i in range(n+1)]
  dp[0][0]=1
  for i in range(n):
    for j in range(2*n):
      for k in range(1,2*n):
        if j+k<2*n:
          dp[i+1][j+k]+=dp[i][j]*C[k]
          dp[i+1][j+k]%=mod
  print(dp[n][2*n-1])
  return

main()
0