結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-11-25 23:12:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 219 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 75,720 KB
最終ジャッジ日時 2024-04-10 04:17:06
合計ジャッジ時間 2,865 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,432 KB
testcase_01 AC 34 ms
53,704 KB
testcase_02 AC 33 ms
52,336 KB
testcase_03 WA -
testcase_04 AC 34 ms
52,884 KB
testcase_05 AC 33 ms
53,500 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 34 ms
52,468 KB
testcase_09 AC 34 ms
52,008 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 34 ms
52,344 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 34 ms
53,348 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 34 ms
52,192 KB
testcase_29 WA -
testcase_30 AC 34 ms
53,076 KB
testcase_31 WA -
testcase_32 AC 35 ms
52,268 KB
testcase_33 WA -
testcase_34 AC 34 ms
52,204 KB
testcase_35 WA -
testcase_36 AC 34 ms
52,216 KB
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = int(input())
mod = 998244353

if n < m:
    print(0)
    exit()
    
ans = 1
for i in range(m-1):
    ans *= n-i
    ans *= pow(1+i,mod-2,mod)
    ans %= mod
ans *= pow(2,n-m+1,mod)-1
print(ans%mod)
0