結果

問題 No.927 Second Permutation
ユーザー kohei2019kohei2019
提出日時 2022-01-04 08:42:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 195 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 88,628 KB
最終ジャッジ日時 2024-04-22 02:06:25
合計ジャッジ時間 3,299 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
51,968 KB
testcase_01 AC 38 ms
51,968 KB
testcase_02 AC 38 ms
51,840 KB
testcase_03 AC 39 ms
51,584 KB
testcase_04 AC 38 ms
52,096 KB
testcase_05 AC 39 ms
52,096 KB
testcase_06 AC 39 ms
51,968 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 43 ms
57,096 KB
testcase_25 AC 42 ms
55,348 KB
testcase_26 AC 42 ms
54,712 KB
testcase_27 AC 41 ms
53,860 KB
testcase_28 AC 44 ms
57,020 KB
testcase_29 AC 43 ms
56,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X = list(input())
X.sort(reverse=True)
N = len(X)
cn = len(set(X))
if cn == 1:
    print(-1)
    exit()
if X.count('0') == N-1:
    print(-1)
    exit()
X[-1],X[-2] = X[-2],X[-1]
print(*X,sep='')
0