結果

問題 No.39 桁の数字を入れ替え
ユーザー Snark86Snark86
提出日時 2016-05-04 03:58:25
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 198 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 11:12:12
合計ジャッジ時間 1,145 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = map(int,raw_input())
m = sorted(n,reverse=True)
a,b = 0,0
for i in range(len(n)):
	if a == 0 and n[i] != m[i]:
		a = i
	if n[i] == m[a]:
		b = i
n[a], n[b] = n[b], n[a]
print "".join(map(str,n))
0