結果

問題 No.927 Second Permutation
ユーザー ptotqptotq
提出日時 2019-11-22 22:03:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 14,016 KB
最終ジャッジ日時 2024-04-19 11:29:58
合計ジャッジ時間 2,163 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 27 ms
10,496 KB
testcase_02 AC 27 ms
10,624 KB
testcase_03 AC 26 ms
10,624 KB
testcase_04 AC 24 ms
10,496 KB
testcase_05 AC 24 ms
10,496 KB
testcase_06 AC 24 ms
10,624 KB
testcase_07 AC 24 ms
10,624 KB
testcase_08 AC 42 ms
11,696 KB
testcase_09 AC 26 ms
10,752 KB
testcase_10 AC 51 ms
12,380 KB
testcase_11 AC 68 ms
13,592 KB
testcase_12 AC 45 ms
12,004 KB
testcase_13 AC 28 ms
11,008 KB
testcase_14 AC 56 ms
12,344 KB
testcase_15 AC 44 ms
11,980 KB
testcase_16 AC 71 ms
13,764 KB
testcase_17 AC 72 ms
13,760 KB
testcase_18 AC 74 ms
13,660 KB
testcase_19 AC 73 ms
13,896 KB
testcase_20 AC 72 ms
13,836 KB
testcase_21 AC 72 ms
14,016 KB
testcase_22 AC 72 ms
13,764 KB
testcase_23 AC 71 ms
13,760 KB
testcase_24 AC 28 ms
11,520 KB
testcase_25 AC 27 ms
11,264 KB
testcase_26 AC 26 ms
11,136 KB
testcase_27 AC 26 ms
10,880 KB
testcase_28 AC 27 ms
11,648 KB
testcase_29 AC 27 ms
11,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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