結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
sekihankamibanz
|
| 提出日時 | 2018-10-27 19:07:39 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 420 bytes |
| 記録 | |
| コンパイル時間 | 366 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-13 15:04:39 |
| 合計ジャッジ時間 | 3,169 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 4 |
ソースコード
n = [x for x in input()]
max_num = max(n)
max_num_index = [x for x, i in enumerate(n) if i == max_num].pop()
for x, i in enumerate(n):
if all(n) == max_num:
break
if i != max_num:
replace_num = i
replace_index = x
if replace_index < max_num_index:
n[max_num_index] = n[replace_index]
n[replace_index] = max_num
break
print(int(''.join(n)))
sekihankamibanz