結果

問題 No.39 桁の数字を入れ替え
ユーザー pluto77
提出日時 2016-02-14 14:51:45
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 289 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 06:29:25
合計ジャッジ時間 1,132 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 RE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding: utf-8
##yuki_39

s=raw_input()
ls=list(s)
lsw=ls[:]
lst=ls[:]
lst.sort()

x=lst[-1]
lst_temp=[]
while lsw[0]==x:
 lst_temp.append(lsw[0])
 del(lsw[0])
i=len(lsw)-1
while i>=0:
 
 if lsw[i]==x:
  idx=i
  break
 i-=1

lsw[0],lsw[idx]=x,lsw[0]
resl=lst_temp+lsw

print "".join(resl)
0