結果
| 問題 |
No.2068 Restricted Permutation
|
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2022-08-27 14:25:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 232 bytes |
| コンパイル時間 | 527 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 109,248 KB |
| 最終ジャッジ日時 | 2024-11-08 19:45:24 |
| 合計ジャッジ時間 | 3,291 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 1 |
| other | AC * 10 RE * 13 |
ソースコード
from itertools import permutations
mod=998244353
n,k,x=map(int,input().split())
if n>10:
raise Exception
Ps=list(permutations(list(range(1,n+1)),n))
res=0
for i in range(len(Ps)):
if Ps[i][k-1]==x:
res+=i
print(res%mod)
とりゐ