結果
問題 |
No.365 ジェンガソート
|
ユーザー |
|
提出日時 | 2018-02-18 16:16:18 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 349 bytes |
コンパイル時間 | 277 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 36,324 KB |
最終ジャッジ日時 | 2024-06-24 13:41:03 |
合計ジャッジ時間 | 5,021 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 3 TLE * 1 -- * 23 |
ソースコード
def main(): N = int(input()) A = {j: i for i, j in enumerate(map(int, input().split()))} len_ = 0 for i in range(N, 1, -1): l = 0 while i > 1: if A[i] > A[i-1]: l += 1 else: break i -= 1 len_ = max(len_, l) print(N - 1 - len_) main()