結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-25 16:52:27 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 393 bytes |
| 記録 | |
| コンパイル時間 | 530 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,616 KB |
| 最終ジャッジ日時 | 2026-02-25 16:52:33 |
| 合計ジャッジ時間 | 4,279 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 19 |
ソースコード
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(list(map(int, array)))