結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 21:03:21 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 5,000 ms |
| コード長 | 328 bytes |
| 記録 | |
| コンパイル時間 | 218 ms |
| コンパイル使用メモリ | 96,232 KB |
| 実行使用メモリ | 79,248 KB |
| 最終ジャッジ日時 | 2026-07-07 12:41:19 |
| 合計ジャッジ時間 | 2,708 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
lam6er