結果
問題 |
No.2384 Permutations of Permutations
|
ユーザー |
👑 ![]() |
提出日時 | 2023-07-14 22:12:51 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 370 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 78,208 KB |
最終ジャッジ日時 | 2024-09-16 07:16:46 |
合計ジャッジ時間 | 2,411 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 WA * 2 |
ソースコード
""" N=2,6以外で答えは(N-K)!*K Aut(SN)の元は全て内部自己同型で、rotateと可換なのはrotateだけなので(?)。 N=2は自明 N=6はわからん。Autが2倍なのでとりあえず2を掛けてみる。外部自己同型の分でK=2,3,6のときはさらに増えるらしいのでとりあえず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 if K in [2,3,6]: ans=ans*2%M print(ans)