結果

問題 No.927 Second Permutation
ユーザー c-yan
提出日時 2020-03-22 01:45:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 178 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 12,160 KB
最終ジャッジ日時 2024-12-24 05:58:51
合計ジャッジ時間 2,320 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

X = input()

t = sorted(X, reverse=True)
Y1 = ''.join(t)

a, b = t[-2], t[-1]
t[-2], t[-1] = b, a
Y2 = ''.join(t)

if Y1 == Y2 or Y2[0] == '0':
    print(-1)
else:
    print(Y2)
0