結果

問題 No.1886 Sum of Slide Max
ユーザー rlangevinrlangevin
提出日時 2023-11-14 12:41:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 331 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 80,920 KB
最終ジャッジ日時 2023-11-14 12:41:17
合計ジャッジ時間 4,685 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
62,636 KB
testcase_01 AC 45 ms
62,636 KB
testcase_02 AC 45 ms
62,636 KB
testcase_03 AC 45 ms
62,636 KB
testcase_04 AC 45 ms
62,636 KB
testcase_05 AC 284 ms
78,904 KB
testcase_06 AC 71 ms
73,784 KB
testcase_07 AC 236 ms
80,920 KB
testcase_08 AC 305 ms
79,032 KB
testcase_09 AC 303 ms
79,032 KB
testcase_10 AC 331 ms
79,032 KB
testcase_11 AC 305 ms
79,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
n = 2*10**5+5
fact = [1] * (n + 1)
invfact = [1] * (n + 1)
for i in range(1, n):
    fact[i + 1] = ((i+1) * fact[i]) % mod
invfact[n] = pow(fact[n], mod - 2, mod)
for i in range(n - 1, -1, -1):
    invfact[i] = invfact[i + 1] * (i + 1) % mod

N = int(input())
for K in range(1, N+1):
    ans = (N - K + 1) * K * fact[N - K] * fact[N + 1] * invfact[N + 1 - K - 1]
    ans *= pow(K + 1, mod - 2, mod)
    ans %= mod
    print(ans)
0