結果

問題 No.927 Second Permutation
ユーザー akanayaakanaya
提出日時 2020-03-29 14:51:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 293 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,484 KB
実行使用メモリ 9,364 KB
最終ジャッジ日時 2023-08-30 18:43:37
合計ジャッジ時間 2,150 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,344 KB
testcase_01 AC 17 ms
8,396 KB
testcase_02 AC 17 ms
8,496 KB
testcase_03 AC 18 ms
8,404 KB
testcase_04 AC 18 ms
8,500 KB
testcase_05 AC 18 ms
8,380 KB
testcase_06 AC 18 ms
8,380 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 26 ms
9,216 KB
testcase_25 AC 24 ms
8,952 KB
testcase_26 AC 22 ms
8,900 KB
testcase_27 AC 21 ms
8,616 KB
testcase_28 AC 25 ms
9,184 KB
testcase_29 AC 24 ms
9,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

x = list(input().strip())

c = Counter(x)

if len(c.keys()) == 1:
    print(-1)
elif c['0'] == len(x) - 1:
    print(-1)
else:
    v = sorted(c.keys())[1]
    c[v] -= 1
    for i in sorted(c.keys(), reverse=True):
        print(i * c[i], end='')
    print(v)

0