結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー hir355hir355
提出日時 2022-11-26 00:08:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 218 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 82,700 KB
実行使用メモリ 75,372 KB
最終ジャッジ日時 2024-04-10 04:59:33
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,884 KB
testcase_01 AC 33 ms
52,208 KB
testcase_02 AC 33 ms
53,180 KB
testcase_03 AC 32 ms
53,260 KB
testcase_04 AC 35 ms
52,628 KB
testcase_05 AC 32 ms
52,064 KB
testcase_06 AC 32 ms
52,608 KB
testcase_07 WA -
testcase_08 AC 33 ms
53,568 KB
testcase_09 AC 34 ms
52,488 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 33 ms
52,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 35 ms
52,480 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 35 ms
51,756 KB
testcase_29 WA -
testcase_30 AC 35 ms
52,200 KB
testcase_31 AC 33 ms
52,064 KB
testcase_32 AC 34 ms
52,752 KB
testcase_33 AC 35 ms
52,700 KB
testcase_34 AC 34 ms
51,744 KB
testcase_35 AC 35 ms
52,544 KB
testcase_36 AC 33 ms
51,980 KB
testcase_37 AC 33 ms
52,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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