結果

問題 No.2384 Permutations of Permutations
ユーザー gew1fw
提出日時 2025-06-12 12:47:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 59,848 KB
最終ジャッジ日時 2025-06-12 12:48:27
合計ジャッジ時間 2,197 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

def main():
    import sys
    input = sys.stdin.read
    N, K = map(int, input().split())
    
    max_fact = N - K
    fact = [1] * (max_fact + 1)
    for i in range(1, max_fact + 1):
        fact[i] = fact[i-1] * i % MOD
    
    ans = K * fact[max_fact] % MOD
    print(ans)

if __name__ == "__main__":
    main()
0