結果
問題 |
No.927 Second Permutation
|
ユーザー |
|
提出日時 | 2019-11-22 21:45:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
MLE
|
実行時間 | - |
コード長 | 292 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 818,176 KB |
最終ジャッジ日時 | 2024-10-11 03:12:20 |
合計ジャッジ時間 | 3,430 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 MLE * 1 -- * 21 |
ソースコード
from itertools import permutations X = list(input()) p = permutations(X) s = [] for i in p: if i[0] != "0": s.append(i) s = list(set(s)) s.sort(reverse=True) ans = "" if len(s) == 1: print(-1) exit() else: ans = ans.join(list(s[1])) print(ans.replace(",", ""))