結果

問題 No.927 Second Permutation
ユーザー shamioshamio
提出日時 2020-06-02 17:10:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 215 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 14,400 KB
最終ジャッジ日時 2024-05-03 06:21:23
合計ジャッジ時間 3,675 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 31 ms
10,496 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 30 ms
10,496 KB
testcase_06 AC 30 ms
10,624 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 59 ms
12,416 KB
testcase_09 AC 33 ms
10,880 KB
testcase_10 AC 75 ms
13,016 KB
testcase_11 AC 101 ms
14,156 KB
testcase_12 AC 65 ms
12,672 KB
testcase_13 AC 36 ms
11,264 KB
testcase_14 AC 76 ms
13,000 KB
testcase_15 AC 63 ms
12,544 KB
testcase_16 AC 109 ms
14,400 KB
testcase_17 AC 108 ms
14,352 KB
testcase_18 AC 109 ms
14,396 KB
testcase_19 AC 108 ms
14,272 KB
testcase_20 AC 109 ms
14,272 KB
testcase_21 AC 110 ms
14,356 KB
testcase_22 AC 108 ms
14,144 KB
testcase_23 AC 109 ms
14,224 KB
testcase_24 AC 65 ms
11,648 KB
testcase_25 AC 53 ms
11,392 KB
testcase_26 AC 47 ms
11,136 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

x = list(map(int, input()))
l = len(x)

x.sort(reverse=True)
for i in range(l - 1, 0, -1):
    if x[i] != x[i-1]:
        x[i], x[i-1] = x[i-1], x[i]
        break

else:
    print(-1)
    exit()

print(*x, sep="")
0