結果

問題 No.39 桁の数字を入れ替え
ユーザー AEnAEn
提出日時 2022-05-15 11:09:03
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 220 bytes
コンパイル時間 709 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 71,412 KB
最終ジャッジ日時 2023-10-01 06:07:07
合計ジャッジ時間 3,368 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,212 KB
testcase_01 AC 75 ms
71,160 KB
testcase_02 AC 72 ms
71,284 KB
testcase_03 AC 73 ms
71,224 KB
testcase_04 AC 72 ms
71,128 KB
testcase_05 AC 73 ms
71,252 KB
testcase_06 AC 72 ms
71,268 KB
testcase_07 AC 72 ms
71,320 KB
testcase_08 AC 73 ms
71,340 KB
testcase_09 AC 72 ms
71,376 KB
testcase_10 AC 71 ms
71,320 KB
testcase_11 AC 73 ms
71,340 KB
testcase_12 AC 72 ms
71,176 KB
testcase_13 AC 73 ms
71,412 KB
testcase_14 AC 72 ms
71,208 KB
testcase_15 AC 72 ms
71,160 KB
testcase_16 AC 73 ms
71,296 KB
testcase_17 AC 75 ms
71,160 KB
testcase_18 AC 75 ms
71,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations
N = list(input())
res = int(''.join(N))
for v in combinations(range(len(N)), 2):
    a = N.copy()
    a[v[0]], a[v[1]] = a[v[1]], a[v[0]]
    res = max(res, int(''.join(a)))
print(res)
0