結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
_KingdomOfMoray
|
| 提出日時 | 2020-01-15 10:17:47 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 22 ms / 5,000 ms |
| + 35µs | |
| コード長 | 400 bytes |
| 記録 | |
| コンパイル時間 | 59 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-10-09 21:47:16 |
| 合計ジャッジ時間 | 1,796 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
import itertools
import copy
n = int(input())
n_list = [str(e) for e in list(str(n))]
comb_list = list(itertools.combinations(list(range(0, len(n_list))), 2))
res = n
for i in range(len(comb_list)):
copy_list = copy.copy(n_list)
front, back = comb_list[i]
copy_list[front], copy_list[back] = copy_list[back], copy_list[front]
res = max(res, int(''.join(copy_list)))
print(res)
_KingdomOfMoray