結果

問題 No.927 Second Permutation
ユーザー y10
提出日時 2020-01-12 18:46:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 218 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 267,600 KB
最終ジャッジ日時 2024-11-30 00:42:37
合計ジャッジ時間 67,709 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 1 TLE * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

x = input()
l = [i for i in x]
ans = sorted("".join(p) for p in permutations(x, len(x)))
if ans[-2] == x:
    print(-1)
elif ans[-2][0] == "0":
    print(-1)
else:
    print(ans[-2])
0