結果
| 問題 |
No.927 Second Permutation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-21 04:02:25 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 86 ms / 2,000 ms |
| コード長 | 234 bytes |
| コンパイル時間 | 218 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 64,000 KB |
| 最終ジャッジ日時 | 2024-12-21 14:39:12 |
| 合計ジャッジ時間 | 3,591 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
X = list(input())
X.sort(reverse=True)
for i in range(len(X)-1, 0, -1):
if X[i]!=X[i-1]:
if X[i]=="0" and i-1==0:
continue
X[i], X[i-1] = X[i-1], X[i]
print("".join(X))
exit()
print(-1)