結果

問題 No.39 桁の数字を入れ替え
ユーザー masumasumath1masumasumath1
提出日時 2019-12-08 11:38:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 256 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 7,912 KB
最終ジャッジ日時 2023-08-28 17:15:05
合計ジャッジ時間 1,481 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,908 KB
testcase_01 AC 15 ms
7,904 KB
testcase_02 AC 15 ms
7,736 KB
testcase_03 AC 15 ms
7,904 KB
testcase_04 AC 15 ms
7,740 KB
testcase_05 AC 16 ms
7,860 KB
testcase_06 AC 15 ms
7,728 KB
testcase_07 AC 15 ms
7,716 KB
testcase_08 AC 15 ms
7,768 KB
testcase_09 AC 15 ms
7,816 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 15 ms
7,836 KB
testcase_15 AC 16 ms
7,764 KB
testcase_16 AC 16 ms
7,836 KB
testcase_17 AC 16 ms
7,732 KB
testcase_18 AC 16 ms
7,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
listN = list(str(N))
maxs = [i for i,x in enumerate(listN) if x == max(listN)]
id = maxs[-1]
for i in range(id):
    if listN[i] < listN[id]:
        listN[i],listN[id] = listN[id],listN[i]
        break
print(int("".join(map(str,listN))))
0