結果

問題 No.927 Second Permutation
ユーザー sasa8uyauya
提出日時 2025-03-14 00:39:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 185 bytes
コンパイル時間 526 ms
コンパイル使用メモリ 82,512 KB
実行使用メモリ 66,196 KB
最終ジャッジ日時 2025-03-14 00:39:24
合計ジャッジ時間 3,846 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

x=list(input())
x.sort()
for i in range(1,len(x)):
	if x[i]!=x[0]:
		if i==len(x)-1 and x[i-1]=="0":
			continue
		x[i],x[i-1]=x[i-1],x[i]
		print("".join(x[::-1]))
		exit()
print("-1")
0