結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー satama6satama6
提出日時 2022-11-25 21:43:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 390 ms
コンパイル使用メモリ 82,476 KB
実行使用メモリ 64,380 KB
最終ジャッジ日時 2024-04-10 02:56:28
合計ジャッジ時間 5,055 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
59,408 KB
testcase_01 AC 36 ms
52,116 KB
testcase_02 AC 36 ms
51,964 KB
testcase_03 AC 36 ms
51,944 KB
testcase_04 AC 35 ms
52,620 KB
testcase_05 AC 35 ms
53,476 KB
testcase_06 AC 35 ms
52,272 KB
testcase_07 AC 36 ms
52,624 KB
testcase_08 AC 35 ms
52,556 KB
testcase_09 AC 36 ms
52,616 KB
testcase_10 AC 36 ms
52,456 KB
testcase_11 AC 36 ms
53,124 KB
testcase_12 AC 36 ms
52,124 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 35 ms
52,724 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
N = int(input())
M = int(input())

ans = 0
tmp = 1

m = N
while m >= M:
    ans += tmp
    tmp *= m
    tmp //= N - m + 1
    while tmp > mod : tmp -= mod
    while ans > mod : ans -= mod
    m -= 1

print(ans)

0