結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー ShirotsumeShirotsume
提出日時 2022-11-25 21:24:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 539 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,788 KB
実行使用メモリ 63,912 KB
最終ジャッジ日時 2024-04-10 02:32:19
合計ジャッジ時間 3,085 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
55,368 KB
testcase_01 AC 38 ms
54,672 KB
testcase_02 AC 39 ms
54,200 KB
testcase_03 AC 39 ms
53,840 KB
testcase_04 AC 39 ms
54,980 KB
testcase_05 AC 38 ms
53,944 KB
testcase_06 WA -
testcase_07 AC 39 ms
54,568 KB
testcase_08 AC 39 ms
54,984 KB
testcase_09 AC 40 ms
54,368 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 38 ms
53,792 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 40 ms
54,560 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 39 ms
54,792 KB
testcase_29 WA -
testcase_30 AC 39 ms
54,796 KB
testcase_31 WA -
testcase_32 AC 40 ms
54,560 KB
testcase_33 WA -
testcase_34 AC 40 ms
53,944 KB
testcase_35 WA -
testcase_36 AC 39 ms
54,240 KB
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

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 *= (m - i)
    C %= mod
    C *= pow(i + 1, mod - 2, mod)
    C %= mod
print(ans)
0