結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
![]() |
提出日時 | 2018-12-05 01:46:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 319 bytes |
コンパイル時間 | 205 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-16 01:50:25 |
合計ジャッジ時間 | 1,485 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 5 |
ソースコード
N = list(input()) max = 0 num_max = 0 for i in range(len(N)-1,-1,-1): if max < int(N[i]): max = int(N[i]) num_max = i irekae_num = 0 for i in range(len(N)): if N[num_max] != N[i]: irekae_num = i break N[irekae_num],N[num_max] = N[num_max],N[irekae_num] print("".join(N))