結果

問題 No.927 Second Permutation
ユーザー s_shoheis_shohei
提出日時 2020-04-13 22:39:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 710 ms
コンパイル使用メモリ 81,712 KB
実行使用メモリ 88,460 KB
最終ジャッジ日時 2023-10-26 03:26:34
合計ジャッジ時間 3,941 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 37 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 37 ms
53,460 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 AC 36 ms
53,460 KB
testcase_08 AC 64 ms
72,832 KB
testcase_09 AC 47 ms
62,416 KB
testcase_10 AC 73 ms
77,208 KB
testcase_11 AC 102 ms
87,524 KB
testcase_12 AC 68 ms
75,532 KB
testcase_13 AC 51 ms
64,472 KB
testcase_14 AC 74 ms
78,104 KB
testcase_15 AC 67 ms
73,436 KB
testcase_16 AC 107 ms
88,460 KB
testcase_17 AC 108 ms
88,196 KB
testcase_18 AC 108 ms
88,460 KB
testcase_19 AC 106 ms
88,196 KB
testcase_20 AC 106 ms
88,196 KB
testcase_21 AC 105 ms
88,460 KB
testcase_22 AC 108 ms
88,196 KB
testcase_23 AC 108 ms
88,460 KB
testcase_24 AC 42 ms
57,012 KB
testcase_25 AC 40 ms
56,524 KB
testcase_26 AC 40 ms
56,252 KB
testcase_27 AC 42 ms
60,132 KB
testcase_28 AC 44 ms
63,012 KB
testcase_29 AC 45 ms
62,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x=list(input())

if len(set(x))==1: # 999
    print(-1)
    exit()

flg=True
for i in range(1,len(x)):
    if x[i] != "0":
        flg=False
if flg:
    print(-1)
    exit()
x.sort()
now=0
for i in range(1,len(x)):
    if x[now] != x[i]:
        x[now],x[i] = x[i],x[now]
        break
    else:
        now=i

x=list(reversed(x))
print(*x,sep="")
0