結果

問題 No.1886 Sum of Slide Max
ユーザー ああいいああいい
提出日時 2022-03-25 22:18:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,104 KB
実行使用メモリ 81,792 KB
最終ジャッジ日時 2024-04-22 06:58:14
合計ジャッジ時間 2,215 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,712 KB
testcase_01 AC 38 ms
51,584 KB
testcase_02 AC 37 ms
52,096 KB
testcase_03 AC 37 ms
52,352 KB
testcase_04 AC 38 ms
51,968 KB
testcase_05 AC 104 ms
79,252 KB
testcase_06 AC 58 ms
67,328 KB
testcase_07 AC 102 ms
81,792 KB
testcase_08 AC 110 ms
79,232 KB
testcase_09 AC 107 ms
79,016 KB
testcase_10 AC 110 ms
79,572 KB
testcase_11 AC 106 ms
79,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
C = N + 10
P = 998244353
fact = [1] * C
fact_inv = [1] * C
for i in range(2,C):
    fact[i] = fact[i-1] * i % P
fact_inv[-1] = pow(fact[-1],P-2,P)
for i in range(C-2,0,-1):
    fact_inv[i] = fact_inv[i+1] * (i+1) % P
def comb(n,k):
    return fact[n] * fact_inv[k] % P * fact_inv[n-k] % P
for i in range(N):
    k = i + 1
    ans = k * fact[k] * fact[N -k  + 1] % P * comb(N+1,k+1) % P
    print(ans)
0