結果

問題 No.39 桁の数字を入れ替え
ユーザー kohei2019kohei2019
提出日時 2021-02-18 15:27:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 5,000 ms
コード長 216 bytes
コンパイル時間 1,011 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 71,796 KB
最終ジャッジ日時 2023-10-12 23:36:55
合計ジャッジ時間 3,427 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,728 KB
testcase_01 AC 88 ms
71,664 KB
testcase_02 AC 92 ms
71,692 KB
testcase_03 AC 87 ms
71,472 KB
testcase_04 AC 87 ms
71,604 KB
testcase_05 AC 87 ms
71,608 KB
testcase_06 AC 88 ms
71,488 KB
testcase_07 AC 89 ms
71,736 KB
testcase_08 AC 87 ms
71,552 KB
testcase_09 AC 87 ms
71,608 KB
testcase_10 AC 88 ms
71,720 KB
testcase_11 AC 90 ms
71,688 KB
testcase_12 AC 90 ms
71,600 KB
testcase_13 AC 90 ms
71,596 KB
testcase_14 AC 89 ms
71,512 KB
testcase_15 AC 89 ms
71,564 KB
testcase_16 AC 87 ms
71,488 KB
testcase_17 AC 88 ms
71,672 KB
testcase_18 AC 89 ms
71,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import copy
N = list(input())
ans = int(''.join(N))
for i in range(len(N)-1):
    for j in range(len(N)):
        N1 = copy.copy(N)
        N1[i],N1[j] = N1[j],N1[i]
        ans = max(ans,int(''.join(N1)))
print(ans)
0