結果

問題 No.927 Second Permutation
ユーザー OhnumaOhnuma
提出日時 2020-04-10 14:33:32
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 270 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 18,688 KB
最終ジャッジ日時 2024-09-15 01:38:28
合計ジャッジ時間 4,647 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 RE * 1 TLE * 1 -- * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
x = list(input())
ans = []
for l in itertools.permutations(x):
    x = ''.join(i for i in l)
    if x[0]=='0':
        continue
    else:
        x = int(x)
        if x not in ans:
            ans.append(x)
print(sorted(ans)[-2] if len(ans)!=1 else -1)
0