結果
| 問題 | No.39 桁の数字を入れ替え |
| コンテスト | |
| ユーザー |
ゆるく
|
| 提出日時 | 2014-10-16 01:12:48 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 341 bytes |
| 記録 | |
| コンパイル時間 | 557 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 20,576 KB |
| 最終ジャッジ日時 | 2026-06-04 00:12:29 |
| 合計ジャッジ時間 | 4,139 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 WA * 1 RE * 3 |
ソースコード
l = list(input())
mx = len(l) - list(reversed(l)).index(max(l)) - 1
if mx != 0:
for i in range(len(l)):
if mx > i:
if int(l[mx]) > int(l[i]):
l[mx], l[i] = l[i], l[mx]
break
else:
mx = len(l) - list(reversed(l)).index(max(l[i+1:])) - 1
print(''.join(l))
ゆるく