結果

問題 No.39 桁の数字を入れ替え
ユーザー AT274_AT274_
提出日時 2019-11-02 13:50:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 21 ms / 5,000 ms
コード長 270 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 8,460 KB
最終ジャッジ日時 2023-10-13 01:23:02
合計ジャッジ時間 1,554 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,380 KB
testcase_01 AC 21 ms
8,424 KB
testcase_02 AC 20 ms
8,312 KB
testcase_03 AC 21 ms
8,340 KB
testcase_04 AC 19 ms
8,412 KB
testcase_05 AC 18 ms
8,380 KB
testcase_06 AC 19 ms
8,296 KB
testcase_07 AC 19 ms
8,344 KB
testcase_08 AC 19 ms
8,360 KB
testcase_09 AC 19 ms
8,420 KB
testcase_10 AC 19 ms
8,352 KB
testcase_11 AC 19 ms
8,292 KB
testcase_12 AC 19 ms
8,264 KB
testcase_13 AC 18 ms
8,460 KB
testcase_14 AC 18 ms
8,428 KB
testcase_15 AC 19 ms
8,408 KB
testcase_16 AC 18 ms
8,404 KB
testcase_17 AC 19 ms
8,404 KB
testcase_18 AC 20 ms
8,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from copy import deepcopy
N = list(map(int, list(input())))


ans = 0
for i in range(len(N)):
    for j in range(len(N)):
        N_copy = deepcopy(N)
        N_copy[i], N_copy[j] = N_copy[j], N_copy[i]
        ans = max(ans, int(''.join(map(str, N_copy))))

print(ans)
0