結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー ShirotsumeShirotsume
提出日時 2022-11-25 21:25:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 539 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 82,036 KB
実行使用メモリ 73,332 KB
最終ジャッジ日時 2024-04-10 02:33:55
合計ジャッジ時間 2,862 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
55,300 KB
testcase_01 AC 37 ms
55,116 KB
testcase_02 AC 39 ms
54,540 KB
testcase_03 AC 36 ms
53,856 KB
testcase_04 AC 37 ms
54,020 KB
testcase_05 AC 37 ms
53,904 KB
testcase_06 AC 37 ms
54,012 KB
testcase_07 AC 36 ms
53,916 KB
testcase_08 AC 36 ms
54,688 KB
testcase_09 AC 36 ms
53,948 KB
testcase_10 AC 37 ms
54,528 KB
testcase_11 AC 36 ms
54,440 KB
testcase_12 AC 37 ms
54,152 KB
testcase_13 AC 36 ms
54,380 KB
testcase_14 AC 38 ms
54,676 KB
testcase_15 AC 36 ms
54,600 KB
testcase_16 AC 36 ms
54,012 KB
testcase_17 AC 45 ms
62,160 KB
testcase_18 AC 49 ms
61,892 KB
testcase_19 AC 51 ms
62,100 KB
testcase_20 AC 37 ms
53,696 KB
testcase_21 AC 55 ms
63,336 KB
testcase_22 AC 37 ms
55,116 KB
testcase_23 AC 53 ms
63,696 KB
testcase_24 AC 36 ms
55,284 KB
testcase_25 AC 52 ms
63,212 KB
testcase_26 AC 37 ms
54,740 KB
testcase_27 AC 141 ms
73,204 KB
testcase_28 AC 39 ms
55,104 KB
testcase_29 AC 142 ms
73,332 KB
testcase_30 AC 37 ms
55,400 KB
testcase_31 AC 37 ms
55,352 KB
testcase_32 AC 36 ms
54,812 KB
testcase_33 AC 36 ms
54,476 KB
testcase_34 AC 36 ms
55,256 KB
testcase_35 AC 37 ms
53,896 KB
testcase_36 AC 36 ms
55,140 KB
testcase_37 AC 36 ms
54,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
sys.setrecursionlimit(5 * 10 ** 5)
from pypyjit import set_param
set_param('max_unroll_recursion=-1')
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n = ii()

m = ii()

if n < m:
    print(0)
    exit()
ans = pow(2, n, mod)

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