結果
| 問題 |
No.696 square1001 and Permutation 5
|
| コンテスト | |
| ユーザー |
_shota_224_
|
| 提出日時 | 2018-06-10 13:09:16 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 347 bytes |
| コンパイル時間 | 79 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 27,376 KB |
| 最終ジャッジ日時 | 2024-06-30 13:16:08 |
| 合計ジャッジ時間 | 22,744 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 11 |
ソースコード
import math N = int(input()) p = list(map(int, input().split())) used_num = [False for i in range(N)] def count_used_num(num): used = 0 for i in range(num-1): if used_num[i]==True: used += 1 return used result = 1 for i, j in enumerate(p): result += (j-1-count_used_num(j)) * math.factorial(N-i-1) used_num[j-1] = True print(result)
_shota_224_