結果
| 問題 | No.927 Second Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-20 20:39:06 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 105 ms / 2,000 ms |
| + 965µs | |
| コード長 | 247 bytes |
| 記録 | |
| コンパイル時間 | 295 ms |
| コンパイル使用メモリ | 21,280 KB |
| 実行使用メモリ | 16,684 KB |
| 最終ジャッジ日時 | 2026-07-26 14:29:56 |
| 合計ジャッジ時間 | 5,249 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
x = list(input())
x.sort(reverse=True)
if len(set(x)) == 1 or x[1] == "0":
print(-1)
else:
for i in range(len(x)-1, 0, -1):
if x[i] != x[i-1]:
x[i], x[i-1] = x[i-1], x[i]
print("".join(x))
break