結果

問題 No.39 桁の数字を入れ替え
ユーザー AEn
提出日時 2022-05-15 11:09:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 220 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-07-26 12:57:27
合計ジャッジ時間 1,986 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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