結果
| 問題 |
No.927 Second Permutation
|
| コンテスト | |
| ユーザー |
Yamada
|
| 提出日時 | 2019-11-25 20:18:31 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 92 ms / 2,000 ms |
| コード長 | 248 bytes |
| コンパイル時間 | 112 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 18,084 KB |
| 最終ジャッジ日時 | 2024-10-14 13:37:54 |
| 合計ジャッジ時間 | 3,030 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
X = [int(i) for i in input()]
X.sort()
s = True
for i in range(len(X)-1):
if X[i] != X[i+1]:
X[i],X[i+1] = X[i+1],X[i]
s = False
break
if s or X[-1] ==0:
print(-1)
else:
print("".join([str(i) for i in X[::-1]]))
Yamada