結果

問題 No.2530 Yellow Cards
ユーザー ニックネームニックネーム
提出日時 2023-11-03 22:43:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 326 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 11,808 KB
実行使用メモリ 10,156 KB
最終ジャッジ日時 2023-11-03 22:43:46
合計ジャッジ時間 4,463 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,060 KB
testcase_01 AC 28 ms
10,076 KB
testcase_02 AC 36 ms
10,076 KB
testcase_03 AC 52 ms
10,076 KB
testcase_04 AC 29 ms
10,076 KB
testcase_05 AC 35 ms
10,076 KB
testcase_06 AC 34 ms
10,156 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
mod = 998244353; d = pow(n,-1,mod); dp = [1]+[0]*n; e = 0
for _ in range(k):
    eq = [0]*(n+1)
    for i in range(n+1):
        if i>0: eq[i-1] = (eq[i-1]+dp[i]*i*d)%mod
        if i<n: eq[i+1] = (eq[i+1]+dp[i]*(n-i)*d)%mod
    dp = eq
for i,v in enumerate(dp): e += ((k-i)//2+n)*v
print(e%mod)
0