結果
| 問題 |
No.2299 Antitypoglycemia
|
| コンテスト | |
| ユーザー |
yassu0320
|
| 提出日時 | 2023-03-13 12:41:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 74 ms / 2,000 ms |
| コード長 | 506 bytes |
| コンパイル時間 | 170 ms |
| コンパイル使用メモリ | 81,664 KB |
| 実行使用メモリ | 69,504 KB |
| 最終ジャッジ日時 | 2024-09-18 07:29:56 |
| 合計ジャッジ時間 | 3,052 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
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)
yassu0320