結果
| 問題 | No.927 Second Permutation |
| コンテスト | |
| ユーザー |
ptotq
|
| 提出日時 | 2019-11-22 22:03:58 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 50 ms / 2,000 ms |
| + 261µs | |
| コード長 | 174 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 13,588 KB |
| 最終ジャッジ日時 | 2026-10-12 04:37:10 |
| 合計ジャッジ時間 | 2,702 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
X = sorted(input())
nums = sorted(set(X))
if len(nums) == 1 or X[-2] == '0':
print(-1)
exit()
i = X.index(nums[1])
X[i-1], X[i] = X[i], X[i-1]
print(*X[::-1], sep='')
ptotq