結果
| 問題 |
No.2384 Permutations of Permutations
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 14:24:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 424 bytes |
| コンパイル時間 | 314 ms |
| コンパイル使用メモリ | 82,040 KB |
| 実行使用メモリ | 59,528 KB |
| 最終ジャッジ日時 | 2025-06-12 14:25:00 |
| 合計ジャッジ時間 | 2,100 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 WA * 5 |
ソースコード
MOD = 998244353
def main():
import sys
input = sys.stdin.read
data = input().split()
N = int(data[0])
K = int(data[1])
m = N - K
if m < 0:
print(0)
return
# Precompute factorial up to m
fact = [1] * (m + 1)
for i in range(1, m + 1):
fact[i] = fact[i-1] * i % MOD
res = K * fact[m] % MOD
print(res)
if __name__ == "__main__":
main()
gew1fw