結果

問題 No.39 桁の数字を入れ替え
ユーザー mkawa2mkawa2
提出日時 2019-12-19 22:47:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,988 KB
実行使用メモリ 9,056 KB
最終ジャッジ日時 2023-09-21 07:35:14
合計ジャッジ時間 1,552 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
8,748 KB
testcase_01 AC 20 ms
8,728 KB
testcase_02 AC 21 ms
8,856 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 21 ms
8,792 KB
testcase_08 AC 21 ms
8,752 KB
testcase_09 AC 21 ms
8,648 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 21 ms
8,800 KB
testcase_15 AC 22 ms
8,700 KB
testcase_16 AC 20 ms
8,896 KB
testcase_17 AC 21 ms
8,636 KB
testcase_18 AC 21 ms
8,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    s=input()
    t=list(s)
    mx=max(t)
    idx=s.rfind(mx)
    if idx>0:t[0],t[idx]=t[idx],t[0]
    print("".join(t))

main()
0