結果

問題 No.1761 Sequence Distance
ユーザー 👑 PCTprobabilityPCTprobability
提出日時 2021-10-24 22:59:51
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 611 bytes
コンパイル時間 686 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 114,960 KB
最終ジャッジ日時 2023-09-01 23:54:27
合計ジャッジ時間 18,801 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,536 KB
testcase_01 AC 72 ms
71,516 KB
testcase_02 AC 2,750 ms
114,960 KB
testcase_03 AC 76 ms
75,832 KB
testcase_04 AC 71 ms
71,068 KB
testcase_05 AC 75 ms
75,768 KB
testcase_06 AC 134 ms
77,604 KB
testcase_07 AC 90 ms
76,408 KB
testcase_08 AC 130 ms
77,352 KB
testcase_09 AC 89 ms
76,700 KB
testcase_10 AC 130 ms
77,504 KB
testcase_11 AC 151 ms
77,880 KB
testcase_12 AC 95 ms
76,572 KB
testcase_13 AC 118 ms
77,704 KB
testcase_14 AC 98 ms
77,312 KB
testcase_15 AC 129 ms
77,404 KB
testcase_16 AC 125 ms
77,352 KB
testcase_17 AC 91 ms
76,796 KB
testcase_18 AC 151 ms
77,820 KB
testcase_19 AC 117 ms
77,500 KB
testcase_20 AC 120 ms
77,700 KB
testcase_21 AC 2,576 ms
90,292 KB
testcase_22 AC 281 ms
78,284 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
権限があれば一括ダウンロードができます

ソースコード

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
  if i%17==0:
    for j in range(0,m+1):
      for k in range(0,45):
        dp[j][k]=dp2[j][k]%mod
        dp2[j][k]=0
  else:
    for j in range(0,m+1):
      for k in range(0,45):
        dp[j][k]=dp2[j][k]
        dp2[j][k]=0 
print(dp[m][0]%mod)
0