結果

問題 No.927 Second Permutation
ユーザー V.ll
提出日時 2020-01-04 19:36:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 200 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-11-22 21:22:17
合計ジャッジ時間 2,650 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 10 RE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

a=sorted(map(int,input()))
if a[-2]==0:print(-1)
elif a[0]==a[-1]:print(-1)
else:
 k=1
 while a[0]==a[k]:k+=1
 a[k]+=a[k-1];a[k-1]=a[k]-a[k-1];a[k]-=a[k-1];print(''.join(list(map(str,input()))[::-1]))
0