結果
| 問題 | No.365 ジェンガソート | 
| コンテスト | |
| ユーザー |  Twizz | 
| 提出日時 | 2017-02-28 02:21:23 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 570 bytes | 
| コンパイル時間 | 184 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 12,416 KB | 
| 最終ジャッジ日時 | 2024-06-11 20:30:15 | 
| 合計ジャッジ時間 | 2,844 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | RE * 41 | 
ソースコード
def switch(list,x):
    y=list.pop(list.index(x))
    list.insert(0,y)
    return list
N=int(input())
list=list(map,(int,input().split))
cnt=0
#print(list)
for i in range(N):
    #print(list[-1:],N-i)
    if list[-1:]==N-i:
        continue
    else:
        index=list.index(N-i)
        new_list=list[index+1:]
        for j in new_list:
            #print("new",new_list)
            list=switch(list,max(new_list))
            new_list.remove(max(new_list))
            cnt+=1
            #print(cnt,list)
        list.remove(N-i)
        #print(list)
print(cnt)
            
            
            
        