結果
| 問題 | No.927 Second Permutation |
| コンテスト | |
| ユーザー |
67oYG9nh2YMmIci
|
| 提出日時 | 2020-07-20 11:26:56 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 117 ms / 2,000 ms |
| コード長 | 275 bytes |
| 記録 | |
| コンパイル時間 | 335 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,988 KB |
| 最終ジャッジ日時 | 2026-05-29 10:14:34 |
| 合計ジャッジ時間 | 4,959 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
X=str(input())
x=[]
y=[]
cnt=0
for i in range(len(X)):
x.append(X[i])
x.sort(reverse=True)
for i in range(len(x)-2,0,-1):
if x[i]!=x[i+1] and x[0]!="0":
x[i],x[i+1]=x[i+1],x[i]
print("".join(x))
cnt+=1
break
if cnt == 0:
print(-1)
67oYG9nh2YMmIci