結果

問題 No.1761 Sequence Distance
ユーザー 👑 PCTprobabilityPCTprobability
提出日時 2021-10-24 22:54:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 4,898 ms / 8,000 ms
コード長 474 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 77,312 KB
最終ジャッジ日時 2024-06-11 06:14:56
合計ジャッジ時間 51,400 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,840 KB
testcase_01 AC 41 ms
58,332 KB
testcase_02 AC 1,321 ms
77,056 KB
testcase_03 AC 43 ms
58,372 KB
testcase_04 AC 42 ms
58,496 KB
testcase_05 AC 41 ms
58,368 KB
testcase_06 AC 75 ms
68,736 KB
testcase_07 AC 54 ms
64,640 KB
testcase_08 AC 74 ms
68,992 KB
testcase_09 AC 56 ms
63,000 KB
testcase_10 AC 73 ms
68,864 KB
testcase_11 AC 86 ms
69,888 KB
testcase_12 AC 57 ms
64,512 KB
testcase_13 AC 66 ms
67,672 KB
testcase_14 AC 66 ms
66,432 KB
testcase_15 AC 81 ms
68,864 KB
testcase_16 AC 78 ms
68,608 KB
testcase_17 AC 58 ms
64,896 KB
testcase_18 AC 89 ms
69,504 KB
testcase_19 AC 67 ms
67,840 KB
testcase_20 AC 68 ms
67,584 KB
testcase_21 AC 1,414 ms
76,032 KB
testcase_22 AC 161 ms
76,116 KB
testcase_23 AC 4,125 ms
77,004 KB
testcase_24 AC 1,276 ms
76,796 KB
testcase_25 AC 3,495 ms
76,784 KB
testcase_26 AC 3,843 ms
77,140 KB
testcase_27 AC 1,932 ms
76,288 KB
testcase_28 AC 1,178 ms
76,728 KB
testcase_29 AC 2,944 ms
76,820 KB
testcase_30 AC 872 ms
76,292 KB
testcase_31 AC 1,675 ms
77,312 KB
testcase_32 AC 209 ms
76,164 KB
testcase_33 AC 2,453 ms
76,672 KB
testcase_34 AC 80 ms
70,016 KB
testcase_35 AC 377 ms
76,056 KB
testcase_36 AC 3,005 ms
76,544 KB
testcase_37 AC 532 ms
76,288 KB
testcase_38 AC 787 ms
76,304 KB
testcase_39 AC 1,787 ms
76,800 KB
testcase_40 AC 836 ms
76,204 KB
testcase_41 AC 4,469 ms
77,012 KB
testcase_42 AC 4,896 ms
77,296 KB
testcase_43 AC 4,898 ms
76,928 KB
testcase_44 AC 36 ms
52,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=998244353
n,m=map(int,input().split())
dp=[[0 for i in range(46)] for j in range(m+1)]
dp2=[[0 for i in range(46)] for j in range(m+1)]
dp[0][0]=2
dp[0][1]=2
for i in range(n-1):
  for j in range(0,m+1):
    for k in range(0,45):
      dp2[j+k][k+1]+=dp[j][k]
      dp2[j+k][k]+=dp[j][k]*2
      dp2[j+k][abs(k-1)]+=dp[j][k]
      if j+k+1>m:
        break
  for j in range(0,m+1):
    for k in range(0,45):
      dp[j][k]=dp2[j][k]%mod
      dp2[j][k]=0
print(dp[m][0])
0