結果
問題 |
No.365 ジェンガソート
|
ユーザー |
![]() |
提出日時 | 2019-04-20 15:14:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 403 bytes |
コンパイル時間 | 305 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 24,720 KB |
最終ジャッジ日時 | 2024-10-01 09:18:00 |
合計ジャッジ時間 | 4,495 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 TLE * 1 -- * 24 |
ソースコード
N = int(input()) a = list(map(int,input().split())) an = [a.index(i+1) for i in range(N)] i = N-1 t = 0 count = 0 while True: if an[i] < an[i-1]: an = list(map(lambda x: x+1 if x <= i else x, an)) an[i-1] = 0 count += 1 t = 1 if i > 1: i -= 1 else: if t == 0: break else: t = 0 i = N-1 print(count)