結果

問題 No.2299 Antitypoglycemia
コンテスト
ユーザー yassu0320
提出日時 2023-03-13 12:41:20
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 506 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 165 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 68,992 KB
最終ジャッジ日時 2026-04-06 14:44:11
合計ジャッジ時間 2,298 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from typing import Dict, Iterable, Set


def inputs(type_=int):
    ins = input().split()

    if isinstance(type_, Iterable):
        return [t(x) for t, x in zip(type_, ins)]
    else:
        return list(map(type_, ins))


n, a, b = inputs()
M = 2 * 10**5 + 10
facs = [1] * M
mod = 998244353

for i in range(1, M):
    facs[i] = facs[i - 1] * i
    facs[i] %= mod

if a != b:
    res = facs[n - 1] + (n - 2) * (n - 2) * facs[n - 2]
else:
    res = (n - 1) * (n - 2) * facs[n - 2]

res %= mod
print(res)
0