結果
| 問題 | No.927 Second Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-21 04:02:25 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 47 ms / 2,000 ms |
| コード長 | 234 bytes |
| 記録 | |
| コンパイル時間 | 140 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 64,256 KB |
| 最終ジャッジ日時 | 2026-05-28 06:38:43 |
| 合計ジャッジ時間 | 2,684 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)