結果

問題 No.927 Second Permutation
ユーザー dangodango
提出日時 2023-06-16 20:15:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 170 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 89,956 KB
最終ジャッジ日時 2023-09-06 17:37:36
合計ジャッジ時間 5,797 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,468 KB
testcase_01 AC 73 ms
71,392 KB
testcase_02 AC 74 ms
71,132 KB
testcase_03 AC 75 ms
70,964 KB
testcase_04 AC 73 ms
71,264 KB
testcase_05 AC 73 ms
71,116 KB
testcase_06 AC 73 ms
70,960 KB
testcase_07 AC 74 ms
71,264 KB
testcase_08 AC 94 ms
78,492 KB
testcase_09 AC 81 ms
76,520 KB
testcase_10 AC 102 ms
80,144 KB
testcase_11 AC 128 ms
88,952 KB
testcase_12 AC 99 ms
79,352 KB
testcase_13 AC 84 ms
76,416 KB
testcase_14 AC 105 ms
80,200 KB
testcase_15 AC 96 ms
79,248 KB
testcase_16 AC 133 ms
89,956 KB
testcase_17 AC 131 ms
89,716 KB
testcase_18 AC 133 ms
89,476 KB
testcase_19 AC 131 ms
89,664 KB
testcase_20 AC 130 ms
89,780 KB
testcase_21 AC 133 ms
89,468 KB
testcase_22 AC 131 ms
89,608 KB
testcase_23 AC 131 ms
89,476 KB
testcase_24 AC 76 ms
72,632 KB
testcase_25 AC 75 ms
72,148 KB
testcase_26 AC 74 ms
72,208 KB
testcase_27 AC 73 ms
71,868 KB
testcase_28 AC 76 ms
72,800 KB
testcase_29 AC 76 ms
72,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X = sorted(input())
N = sorted(set(X))
if len(N) == 1 or X[-2] == '0':
    print(-1)
    exit(0)
I = X.index(N[1])
X[I - 1], X[I] = X[I], X[I - 1]
print(*X[::-1], sep='')
0