結果

問題 No.2384 Permutations of Permutations
ユーザー testestesttestestest
提出日時 2023-07-14 21:44:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 1,279 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 79,032 KB
最終ジャッジ日時 2023-10-14 11:48:43
合計ジャッジ時間 4,288 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,300 KB
testcase_01 AC 71 ms
71,240 KB
testcase_02 AC 71 ms
71,632 KB
testcase_03 AC 70 ms
71,380 KB
testcase_04 AC 71 ms
71,464 KB
testcase_05 AC 182 ms
79,032 KB
testcase_06 AC 165 ms
79,028 KB
testcase_07 AC 72 ms
71,116 KB
testcase_08 AC 71 ms
71,204 KB
testcase_09 AC 72 ms
71,332 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 71 ms
71,340 KB
testcase_13 AC 70 ms
71,332 KB
testcase_14 WA -
testcase_15 AC 90 ms
76,192 KB
testcase_16 AC 89 ms
76,328 KB
testcase_17 AC 124 ms
76,500 KB
testcase_18 AC 86 ms
76,220 KB
testcase_19 AC 75 ms
75,500 KB
testcase_20 AC 72 ms
71,296 KB
testcase_21 AC 83 ms
76,240 KB
testcase_22 AC 72 ms
71,220 KB
testcase_23 AC 111 ms
76,656 KB
権限があれば一括ダウンロードができます

ソースコード

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