結果

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

ソースコード

diff #

from itertools import permutations

x = list(input())
set_x = set("".join(p) for p in permutations(x, len(x)) if p[0] != "0")
if len(set_x) == 1:
    print(-1)
else:
    print(sorted(list(set_x))[-2])
0