結果

問題 No.39 桁の数字を入れ替え
ユーザー けむけむけむけむ
提出日時 2021-07-09 16:36:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 7,984 KB
最終ジャッジ日時 2023-09-14 06:30:52
合計ジャッジ時間 1,991 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 16 ms
7,936 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 16 ms
7,864 KB
testcase_08 AC 15 ms
7,748 KB
testcase_09 AC 16 ms
7,848 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 16 ms
7,848 KB
testcase_15 AC 15 ms
7,920 KB
testcase_16 AC 15 ms
7,868 KB
testcase_17 AC 15 ms
7,932 KB
testcase_18 AC 15 ms
7,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def change(N):
    N_li = list(str(N))
    for i in range(len(N_li)):
        N_li[i] = int(N_li[i])
    n_max = max(N_li)
    for j in range(1, len(N_li) + 1):
        if N_li[-j] == n_max:
            N_li[-j] = 0 + N_li[0]
            N_li[0] = n_max
            break
    s = ''
    for k in range(len(N_li)):
        s += str(N_li[k])
    return int(s)

def main():
    N = int(input())
    print(change(N))

if __name__ == '__main__':
    main()
0