結果

問題 No.39 桁の数字を入れ替え
ユーザー 👑 rin204rin204
提出日時 2022-01-20 21:14:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 5,000 ms
コード長 214 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 71,448 KB
最終ジャッジ日時 2023-08-15 21:14:42
合計ジャッジ時間 2,629 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,124 KB
testcase_01 AC 64 ms
71,368 KB
testcase_02 AC 64 ms
71,340 KB
testcase_03 AC 64 ms
71,388 KB
testcase_04 AC 68 ms
71,408 KB
testcase_05 AC 63 ms
71,120 KB
testcase_06 AC 64 ms
71,360 KB
testcase_07 AC 63 ms
71,300 KB
testcase_08 AC 63 ms
71,340 KB
testcase_09 AC 62 ms
71,416 KB
testcase_10 AC 61 ms
71,224 KB
testcase_11 AC 64 ms
71,160 KB
testcase_12 AC 62 ms
71,340 KB
testcase_13 AC 64 ms
71,448 KB
testcase_14 AC 60 ms
71,128 KB
testcase_15 AC 63 ms
71,392 KB
testcase_16 AC 62 ms
71,272 KB
testcase_17 AC 61 ms
71,436 KB
testcase_18 AC 64 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = list(input())
l = len(n)
ans = int("".join(n))
for i in range(l):
    for j in range(i + 1, l):
        n[i], n[j] = n[j], n[i]
        ans = max(ans, int("".join(n)))
        n[i], n[j] = n[j], n[i]
print(ans)
0