結果

問題 No.1761 Sequence Distance
ユーザー 👑 PCTprobabilityPCTprobability
提出日時 2021-10-24 22:54:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 5,453 ms / 8,000 ms
コード長 474 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 78,280 KB
最終ジャッジ日時 2023-09-01 23:55:44
合計ジャッジ時間 57,871 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,228 KB
testcase_01 AC 74 ms
75,888 KB
testcase_02 AC 1,466 ms
78,280 KB
testcase_03 AC 77 ms
76,068 KB
testcase_04 AC 74 ms
75,876 KB
testcase_05 AC 75 ms
75,836 KB
testcase_06 AC 113 ms
77,284 KB
testcase_07 AC 88 ms
76,676 KB
testcase_08 AC 110 ms
77,108 KB
testcase_09 AC 89 ms
76,496 KB
testcase_10 AC 113 ms
77,280 KB
testcase_11 AC 123 ms
76,936 KB
testcase_12 AC 90 ms
76,692 KB
testcase_13 AC 104 ms
77,220 KB
testcase_14 AC 96 ms
77,260 KB
testcase_15 AC 109 ms
77,264 KB
testcase_16 AC 111 ms
77,216 KB
testcase_17 AC 91 ms
76,484 KB
testcase_18 AC 123 ms
76,936 KB
testcase_19 AC 101 ms
77,140 KB
testcase_20 AC 103 ms
77,328 KB
testcase_21 AC 1,542 ms
77,556 KB
testcase_22 AC 203 ms
77,744 KB
testcase_23 AC 4,557 ms
78,248 KB
testcase_24 AC 1,428 ms
78,084 KB
testcase_25 AC 3,871 ms
77,960 KB
testcase_26 AC 3,998 ms
78,160 KB
testcase_27 AC 1,921 ms
77,476 KB
testcase_28 AC 1,309 ms
77,868 KB
testcase_29 AC 3,213 ms
77,996 KB
testcase_30 AC 976 ms
77,556 KB
testcase_31 AC 1,866 ms
77,900 KB
testcase_32 AC 260 ms
77,460 KB
testcase_33 AC 2,747 ms
77,696 KB
testcase_34 AC 120 ms
77,140 KB
testcase_35 AC 437 ms
77,328 KB
testcase_36 AC 3,192 ms
77,980 KB
testcase_37 AC 589 ms
77,424 KB
testcase_38 AC 893 ms
77,632 KB
testcase_39 AC 1,981 ms
77,636 KB
testcase_40 AC 932 ms
77,704 KB
testcase_41 AC 4,915 ms
78,144 KB
testcase_42 AC 5,408 ms
78,148 KB
testcase_43 AC 5,453 ms
78,132 KB
testcase_44 AC 72 ms
71,072 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