結果

問題 No.927 Second Permutation
ユーザー 👑 H20H20
提出日時 2021-11-03 02:00:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 82,488 KB
実行使用メモリ 65,896 KB
最終ジャッジ日時 2024-04-20 14:28:55
合計ジャッジ時間 2,538 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,084 KB
testcase_01 AC 36 ms
53,156 KB
testcase_02 AC 37 ms
52,284 KB
testcase_03 AC 36 ms
52,752 KB
testcase_04 AC 35 ms
52,728 KB
testcase_05 AC 35 ms
52,732 KB
testcase_06 AC 39 ms
52,568 KB
testcase_07 AC 39 ms
52,404 KB
testcase_08 AC 48 ms
60,916 KB
testcase_09 AC 37 ms
53,248 KB
testcase_10 AC 55 ms
63,012 KB
testcase_11 AC 68 ms
65,832 KB
testcase_12 AC 50 ms
61,664 KB
testcase_13 AC 39 ms
53,684 KB
testcase_14 AC 54 ms
61,996 KB
testcase_15 AC 52 ms
62,012 KB
testcase_16 AC 67 ms
65,088 KB
testcase_17 AC 65 ms
65,496 KB
testcase_18 AC 68 ms
64,288 KB
testcase_19 AC 71 ms
65,028 KB
testcase_20 AC 67 ms
64,744 KB
testcase_21 AC 68 ms
64,700 KB
testcase_22 AC 68 ms
65,712 KB
testcase_23 AC 69 ms
65,252 KB
testcase_24 AC 46 ms
65,896 KB
testcase_25 AC 43 ms
63,740 KB
testcase_26 AC 42 ms
62,760 KB
testcase_27 AC 42 ms
60,632 KB
testcase_28 AC 45 ms
65,196 KB
testcase_29 AC 43 ms
62,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X = list(input())
X.sort(reverse=True)
for i in reversed(range(len(X)-1)):
    if X[i]!=X[i+1]:
        X[i],X[i+1]=X[i+1],X[i]
        if X[0]!='0':
            print(''.join(X))
            exit()
print(-1)
0