結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
![]() |
提出日時 | 2022-11-04 22:56:26 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 39 ms / 5,000 ms |
コード長 | 244 bytes |
コンパイル時間 | 252 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 52,096 KB |
最終ジャッジ日時 | 2024-07-18 20:51:24 |
合計ジャッジ時間 | 1,837 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
import sys input=lambda:sys.stdin.readline().rstrip() def calc(a): if len(a)==1: return a A=list(map(int,a)) M=max(A) if A[0]==M: return a[0]+calc(a[1:]) i=len(A)-1-A[::-1].index(M) return a[i]+a[1:i]+a[0]+a[i+1:] print(calc(input()))