結果
| 問題 | No.927 Second Permutation |
| コンテスト | |
| ユーザー |
komkompi
|
| 提出日時 | 2019-11-25 22:00:34 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
WA
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 283 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 15,232 KB |
| 実行使用メモリ | 12,836 KB |
| 最終ジャッジ日時 | 2026-10-12 04:40:15 |
| 合計ジャッジ時間 | 2,436 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 WA * 1 |
ソースコード
# coding: utf-8
# Your code here!
X=list(input())
X.sort(reverse=True)
temp=X[:]
i=-1
while True:
if X[i]=="0" and X[i-1]=="0":
i-=1
else:
break
#print(i)
X[i-1],X[i]=X[i],X[i-1]
#print(X)
if temp==X or X[0]=="0":
print(-1)
else:
print("".join(X))
komkompi