結果

問題 No.927 Second Permutation
ユーザー numatanumanuma
提出日時 2020-03-10 06:17:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 301 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-15 23:04:49
合計ジャッジ時間 2,195 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 2 RE * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

X = input()

if int(X) % 10 == 0 or len(set(X)) == 1:
    print(-1)
else:
    X = list(X)
    X.sort()
    p = X[0]
    n = len(X)
    for i in range(1, n):
        if p != X[i]:
            tmp = X[i]
            X[i] = p
            X[0] = tmp
            print(''.join(X[::-1]))
            exit()
0