結果

問題 No.39 桁の数字を入れ替え
ユーザー convexineqconvexineq
提出日時 2020-11-25 07:22:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 5,000 ms
コード長 201 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 86,540 KB
実行使用メモリ 71,300 KB
最終ジャッジ日時 2023-10-01 01:40:15
合計ジャッジ時間 2,748 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
70,688 KB
testcase_01 AC 77 ms
71,036 KB
testcase_02 AC 80 ms
71,132 KB
testcase_03 AC 79 ms
71,140 KB
testcase_04 AC 78 ms
71,044 KB
testcase_05 AC 79 ms
71,136 KB
testcase_06 AC 80 ms
71,296 KB
testcase_07 AC 79 ms
71,136 KB
testcase_08 AC 78 ms
71,128 KB
testcase_09 AC 79 ms
71,148 KB
testcase_10 AC 77 ms
71,300 KB
testcase_11 AC 79 ms
71,084 KB
testcase_12 AC 80 ms
71,036 KB
testcase_13 AC 78 ms
71,136 KB
testcase_14 AC 80 ms
71,288 KB
testcase_15 AC 78 ms
71,084 KB
testcase_16 AC 78 ms
71,136 KB
testcase_17 AC 81 ms
71,264 KB
testcase_18 AC 79 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = [*input()]
L = len(n)
s = [int("".join(n))]
for i in range(L):
    for j in range(i+1,L):
        n[i],n[j] = n[j],n[i]
        s.append(int("".join(n)))
        n[i],n[j] = n[j],n[i]
print(max(s))
0