結果
| 問題 |
No.927 Second Permutation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-01-17 23:53:45 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 269 bytes |
| コンパイル時間 | 150 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 12,800 KB |
| 最終ジャッジ日時 | 2024-06-26 01:59:45 |
| 合計ジャッジ時間 | 2,622 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 RE * 18 |
ソースコード
# 2020/01/17
x=sorted(list(input()),reverse=True)
n=len(x)
for i in reversed(range(1,n)):
if x[i-1]==x[i]:continue
x[i],x[i-1]=x[i-1],x[i]
break
else:
print(-1)
exit()
ans=int(''.join(x))
if len(str(ans))==len(x):
print(ans)
else:print(-1)