結果

問題 No.927 Second Permutation
ユーザー s_shoheis_shohei
提出日時 2020-04-13 22:35:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 81,748 KB
実行使用メモリ 88,488 KB
最終ジャッジ日時 2023-10-26 03:18:56
合計ジャッジ時間 4,584 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,364 KB
testcase_01 AC 38 ms
53,364 KB
testcase_02 AC 38 ms
53,364 KB
testcase_03 AC 37 ms
53,364 KB
testcase_04 AC 37 ms
53,364 KB
testcase_05 AC 37 ms
53,364 KB
testcase_06 AC 38 ms
53,364 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 41 ms
56,920 KB
testcase_25 AC 41 ms
56,432 KB
testcase_26 AC 39 ms
56,160 KB
testcase_27 AC 43 ms
60,032 KB
testcase_28 AC 45 ms
62,912 KB
testcase_29 AC 44 ms
62,632 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()
for i in range(1,len(x)):
    if x[0] != x[i]:
        x[0],x[i] = x[i],x[0]
        break
x=list(reversed(x))
print(*x,sep="")
0