結果
問題 | No.927 Second Permutation |
ユーザー |
![]() |
提出日時 | 2024-07-10 08:56:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 107 ms / 2,000 ms |
コード長 | 251 bytes |
コンパイル時間 | 361 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 88,196 KB |
最終ジャッジ日時 | 2024-07-10 08:56:21 |
合計ジャッジ時間 | 4,410 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
X = list(input())X.sort(reverse=True)for i in range(len(X) - 2, -1, -1):if X[i] != X[i + 1]:X[i], X[i + 1] = X[i + 1], X[i]breakelse:print(-1)exit()if X[0] == "0":print(-1)else:print(*X, sep="")