結果

問題 No.1761 Sequence Distance
ユーザー 👑 PCTprobabilityPCTprobability
提出日時 2021-10-16 06:04:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,982 ms / 8,000 ms
コード長 550 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 78,600 KB
最終ジャッジ日時 2023-09-01 23:41:32
合計ジャッジ時間 39,411 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,676 KB
testcase_01 AC 68 ms
71,348 KB
testcase_02 AC 1,041 ms
78,136 KB
testcase_03 AC 68 ms
71,344 KB
testcase_04 AC 69 ms
71,648 KB
testcase_05 AC 69 ms
71,124 KB
testcase_06 AC 96 ms
77,476 KB
testcase_07 AC 86 ms
76,640 KB
testcase_08 AC 91 ms
76,456 KB
testcase_09 AC 85 ms
76,580 KB
testcase_10 AC 98 ms
77,400 KB
testcase_11 AC 106 ms
77,324 KB
testcase_12 AC 89 ms
76,800 KB
testcase_13 AC 97 ms
77,352 KB
testcase_14 AC 88 ms
76,744 KB
testcase_15 AC 100 ms
77,372 KB
testcase_16 AC 91 ms
76,716 KB
testcase_17 AC 88 ms
76,788 KB
testcase_18 AC 107 ms
77,212 KB
testcase_19 AC 90 ms
76,756 KB
testcase_20 AC 93 ms
77,344 KB
testcase_21 AC 751 ms
77,640 KB
testcase_22 AC 133 ms
77,612 KB
testcase_23 AC 3,134 ms
78,336 KB
testcase_24 AC 998 ms
78,176 KB
testcase_25 AC 2,580 ms
78,600 KB
testcase_26 AC 2,809 ms
78,024 KB
testcase_27 AC 927 ms
77,588 KB
testcase_28 AC 831 ms
78,068 KB
testcase_29 AC 2,319 ms
78,336 KB
testcase_30 AC 457 ms
77,648 KB
testcase_31 AC 1,267 ms
78,176 KB
testcase_32 AC 161 ms
77,476 KB
testcase_33 AC 1,513 ms
78,016 KB
testcase_34 AC 107 ms
77,344 KB
testcase_35 AC 194 ms
77,644 KB
testcase_36 AC 2,064 ms
78,008 KB
testcase_37 AC 301 ms
77,820 KB
testcase_38 AC 485 ms
77,616 KB
testcase_39 AC 1,135 ms
77,924 KB
testcase_40 AC 408 ms
77,612 KB
testcase_41 AC 3,558 ms
78,440 KB
testcase_42 AC 3,982 ms
78,204 KB
testcase_43 AC 3,940 ms
78,044 KB
testcase_44 AC 69 ms
71,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=998244353
n,m=map(int,input().split())
dp=[[0 for i in range(50)] for j in range(m+1)]
dp2=[[0 for i in range(50)] 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,50):
      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 (k+1)*(k+1)>m:
        break
      if j+k+1>m:
        break
  for j in range(0,m+1):
    for k in range(0,50):
      dp[j][k]=dp2[j][k]%mod
      dp2[j][k]=0
      if (k+1)*(k+1)>m:
        break
print(dp[m][0])
0