結果

問題 No.2130 分配方法の数え上げ mod 998244353
ユーザー tassei903tassei903
提出日時 2022-11-26 00:30:58
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 185 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 641 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 76,564 KB
最終ジャッジ日時 2023-07-25 12:29:22
合計ジャッジ時間 6,250 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,332 KB
testcase_01 AC 76 ms
71,204 KB
testcase_02 AC 77 ms
71,192 KB
testcase_03 AC 76 ms
71,312 KB
testcase_04 AC 77 ms
71,224 KB
testcase_05 AC 75 ms
71,212 KB
testcase_06 AC 78 ms
70,980 KB
testcase_07 AC 74 ms
70,924 KB
testcase_08 AC 77 ms
71,224 KB
testcase_09 AC 76 ms
71,232 KB
testcase_10 AC 77 ms
71,148 KB
testcase_11 AC 75 ms
71,156 KB
testcase_12 AC 78 ms
71,324 KB
testcase_13 AC 78 ms
70,960 KB
testcase_14 AC 78 ms
71,196 KB
testcase_15 AC 78 ms
71,204 KB
testcase_16 AC 76 ms
71,348 KB
testcase_17 AC 87 ms
76,032 KB
testcase_18 AC 94 ms
76,172 KB
testcase_19 AC 92 ms
76,080 KB
testcase_20 AC 78 ms
71,364 KB
testcase_21 AC 96 ms
76,000 KB
testcase_22 AC 77 ms
71,232 KB
testcase_23 AC 93 ms
75,964 KB
testcase_24 AC 77 ms
71,064 KB
testcase_25 AC 93 ms
76,268 KB
testcase_26 AC 76 ms
71,292 KB
testcase_27 AC 185 ms
76,564 KB
testcase_28 AC 75 ms
71,392 KB
testcase_29 AC 185 ms
76,484 KB
testcase_30 AC 75 ms
71,216 KB
testcase_31 AC 77 ms
71,220 KB
testcase_32 AC 77 ms
71,064 KB
testcase_33 AC 77 ms
71,248 KB
testcase_34 AC 75 ms
71,188 KB
testcase_35 AC 75 ms
71,232 KB
testcase_36 AC 76 ms
71,392 KB
testcase_37 AC 77 ms
70,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

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

print((pow(2, n,mod)-ans)%mod)
0