結果

問題 No.927 Second Permutation
ユーザー 👑 H20H20
提出日時 2021-11-03 01:43:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 210 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,824 KB
実行使用メモリ 69,260 KB
最終ジャッジ日時 2024-04-20 14:07:05
合計ジャッジ時間 2,756 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,560 KB
testcase_01 AC 35 ms
53,272 KB
testcase_02 AC 34 ms
52,700 KB
testcase_03 AC 32 ms
52,964 KB
testcase_04 AC 33 ms
51,824 KB
testcase_05 AC 33 ms
52,936 KB
testcase_06 AC 34 ms
52,504 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 44 ms
64,776 KB
testcase_25 AC 41 ms
63,516 KB
testcase_26 AC 40 ms
61,772 KB
testcase_27 AC 43 ms
60,912 KB
testcase_28 AC 43 ms
65,456 KB
testcase_29 AC 41 ms
64,232 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[i]!='0':
            print(''.join(X))
            exit()
print(-1)

0