結果

問題 No.927 Second Permutation
ユーザー matriematrie
提出日時 2020-12-16 07:09:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 188 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 11,784 KB
実行使用メモリ 19,280 KB
最終ジャッジ日時 2023-10-20 08:59:30
合計ジャッジ時間 17,504 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
17,132 KB
testcase_01 AC 28 ms
10,092 KB
testcase_02 AC 27 ms
10,092 KB
testcase_03 AC 27 ms
10,092 KB
testcase_04 AC 28 ms
10,092 KB
testcase_05 AC 27 ms
10,092 KB
testcase_06 AC 27 ms
10,092 KB
testcase_07 AC 28 ms
10,092 KB
testcase_08 AC 192 ms
13,240 KB
testcase_09 AC 30 ms
10,300 KB
testcase_10 AC 417 ms
15,212 KB
testcase_11 AC 1,058 ms
18,352 KB
testcase_12 AC 259 ms
13,904 KB
testcase_13 AC 38 ms
10,776 KB
testcase_14 AC 449 ms
15,468 KB
testcase_15 AC 243 ms
13,888 KB
testcase_16 AC 1,261 ms
19,280 KB
testcase_17 AC 1,252 ms
19,280 KB
testcase_18 AC 1,240 ms
19,280 KB
testcase_19 AC 1,267 ms
19,280 KB
testcase_20 AC 1,224 ms
19,280 KB
testcase_21 AC 1,275 ms
19,280 KB
testcase_22 AC 1,273 ms
19,280 KB
testcase_23 AC 1,255 ms
19,280 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

s=list(map(int,list(input())))
s=sorted(s)[::-1]
l=[x for x in s]
x=-1
for i in range(1,len(s)):
	l[-i],l[-i-1]=l[-i-1],l[-i]
	if l!=s and l[0]!=0: 
		x=''.join(map(str,l)); break
print(x)
0