結果

問題 No.39 桁の数字を入れ替え
ユーザー pluto77pluto77
提出日時 2016-02-14 14:51:45
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 289 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 7,116 KB
実行使用メモリ 6,456 KB
最終ジャッジ日時 2023-10-22 05:13:37
合計ジャッジ時間 1,116 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 11 ms
6,360 KB
testcase_02 RE -
testcase_03 AC 11 ms
6,360 KB
testcase_04 AC 12 ms
6,360 KB
testcase_05 AC 12 ms
6,360 KB
testcase_06 AC 12 ms
6,360 KB
testcase_07 AC 12 ms
6,360 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 11 ms
6,360 KB
testcase_15 AC 10 ms
6,360 KB
testcase_16 AC 11 ms
6,360 KB
testcase_17 AC 11 ms
6,360 KB
testcase_18 AC 10 ms
6,360 KB
権限があれば一括ダウンロードができます

ソースコード

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