結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
![]() |
提出日時 | 2018-10-27 19:01:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 360 bytes |
コンパイル時間 | 190 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-19 06:50:06 |
合計ジャッジ時間 | 1,399 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 WA * 4 RE * 3 |
ソースコード
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 i != max_num: replace_num = i replace_index = x break if replace_index < max_num_index: n[max_num_index] = n[replace_index] n[replace_index] = max_num print(int(''.join(n)))