結果
| 問題 |
No.39 桁の数字を入れ替え
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 21:03:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 5,000 ms |
| コード長 | 328 bytes |
| コンパイル時間 | 166 ms |
| コンパイル使用メモリ | 82,400 KB |
| 実行使用メモリ | 53,636 KB |
| 最終ジャッジ日時 | 2025-03-20 21:03:36 |
| 合計ジャッジ時間 | 1,757 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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