結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-25 16:55:50 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 407 bytes |
| 記録 | |
| コンパイル時間 | 562 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 15,616 KB |
| 最終ジャッジ日時 | 2026-02-25 16:55:55 |
| 合計ジャッジ時間 | 4,194 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 4 |
ソースコード
N = input()
array = list(N)
for i in range(len(N)):
if int(array[i]) != sorted(list(map(int, array)))[-i-1]:
switch_value = sorted(list(map(int, array)))[-i-1]
switch_index = list(map(int, array)).index(switch_value)
temp = array[i]
array[i] = switch_value
array[switch_index] = temp
break
else:
pass
print(int("".join(list(map(str, array)))))