結果

問題 No.2528 pop_(backfront or not)
ユーザー ニックネームニックネーム
提出日時 2023-11-03 21:56:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 373 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 11,796 KB
実行使用メモリ 51,692 KB
最終ジャッジ日時 2023-11-03 21:56:25
合計ジャッジ時間 5,537 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,084 KB
testcase_01 AC 27 ms
10,084 KB
testcase_02 AC 29 ms
10,084 KB
testcase_03 AC 28 ms
10,084 KB
testcase_04 AC 28 ms
10,084 KB
testcase_05 AC 57 ms
10,516 KB
testcase_06 AC 80 ms
10,940 KB
testcase_07 AC 195 ms
12,804 KB
testcase_08 AC 284 ms
14,124 KB
testcase_09 AC 971 ms
24,156 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input()); mod = 998244353
dp = [[0]*(2*n+1-i) for i in range(2*n+1)]; dp[1][1] = 1
for i in range(1,2*n+1):
    for j in range(1,2*n+1-i):
        if i>2: dp[i][j] += (i-2)*(i-1)//2*dp[i-2][j]
        if j>2: dp[i][j] += (j-2)*(j-1)//2*dp[i][j-2]
        if i>1<j: dp[i][j] += dp[i-1][j-1]*(i*j-i-j+2)
        dp[i][j] %= mod
for i in range(2*n+1): print(dp[i][-1])
0