結果

問題 No.2384 Permutations of Permutations
ユーザー 👑 testestest
提出日時 2023-07-14 21:44:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 78,000 KB
最終ジャッジ日時 2024-09-16 06:38:19
合計ジャッジ時間 2,329 ms
ジャッジサーバーID
(参考情報)
judge6 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

"""
N=2,6以外で答えは(N-K)!*N-K
Aut(SN)の元は全て内部自己同型で、rotateと可換なのはrotateだけなので(?)。
N=2は自明
N=6はわからん。Autが2倍なのでとりあえず2を掛けてみる。当たったらラッキー
"""

import math
N,K=map(int,input().split())
M=998244353
if N==2:
  print(1)
else:
  ans=math.factorial(N-K)*K%M
  if N==6:
    ans=ans*2%M
  print(ans)
0