結果

問題 No.927 Second Permutation
ユーザー popketle
提出日時 2019-12-22 05:09:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 173 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 14,156 KB
最終ジャッジ日時 2024-09-13 14:41:38
合計ジャッジ時間 2,402 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

X=list(map(int,input()))

first=sorted(X,reverse=True)
second=first[:-2]+[first[-1]]+[first[-2]]
if second[0]!=0 and first!=second:
  print(*second,sep='')
else:
  print(-1)
0