結果

問題 No.927 Second Permutation
ユーザー H20
提出日時 2021-11-03 01:43:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 210 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 68,472 KB
最終ジャッジ日時 2024-10-12 09:39:42
合計ジャッジ時間 3,119 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

X = list(input())
X.sort(reverse=True)
for i in reversed(range(len(X)-1)):
    if X[i]!=X[i+1]:
        X[i],X[i+1]=X[i+1],X[i]
        if X[i]!='0':
            print(''.join(X))
            exit()
print(-1)

0