結果

問題 No.2299 Antitypoglycemia
ユーザー H20
提出日時 2023-05-19 09:15:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 184 bytes
コンパイル時間 904 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 74,268 KB
最終ジャッジ日時 2024-12-17 18:15:19
合計ジャッジ時間 3,094 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

N,A,B = map(int,input().split())
P = [1]
mod = 998244353
for i in range(1,N+1):
    P.append(P[-1]*i%mod)
if A==B:
    print(P[N]-P[N-1]*2)
else:
    print((P[N]-P[N-1]*2+P[N-2])%mod)
0