結果

問題 No.39 桁の数字を入れ替え
ユーザー TawaraTawara
提出日時 2015-10-15 13:23:14
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 178 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 6,672 KB
実行使用メモリ 6,024 KB
最終ジャッジ日時 2023-09-28 21:49:02
合計ジャッジ時間 1,763 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N = list(raw_input())[::-1]
l = len(N)
for i in xrange(l):
	m = max(N[:l-i])
	idx = N.index(m)
	if idx < l-1-i:
		N[idx],N[l-1-i] = N[l-1-i],N[idx]
		break
print "".join(N[::-1])
0