結果
| 問題 | No.39 桁の数字を入れ替え | 
| コンテスト | |
| ユーザー |  lam6er | 
| 提出日時 | 2025-03-20 18:56:33 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 37 ms / 5,000 ms | 
| コード長 | 328 bytes | 
| コンパイル時間 | 140 ms | 
| コンパイル使用メモリ | 82,304 KB | 
| 実行使用メモリ | 53,800 KB | 
| 最終ジャッジ日時 | 2025-03-20 18:57:42 | 
| 合計ジャッジ時間 | 1,523 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
ソースコード
n = input().strip()
max_num = n
digits = list(n)
length = len(digits)
for i in range(length):
    for j in range(i + 1, length):
        swapped = digits.copy()
        swapped[i], swapped[j] = swapped[j], swapped[i]
        current = ''.join(swapped)
        if current > max_num:
            max_num = current
print(max_num)
            
            
            
        