結果

問題 No.927 Second Permutation
ユーザー numberfromnumberfrom
提出日時 2019-11-22 21:45:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 292 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 821,376 KB
最終ジャッジ日時 2024-04-19 10:54:32
合計ジャッジ時間 2,590 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,496 KB
testcase_01 AC 29 ms
10,624 KB
testcase_02 AC 27 ms
10,368 KB
testcase_03 AC 28 ms
10,496 KB
testcase_04 AC 27 ms
10,368 KB
testcase_05 AC 27 ms
10,624 KB
testcase_06 AC 25 ms
10,496 KB
testcase_07 AC 27 ms
10,624 KB
testcase_08 MLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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(",", ""))
0