help pls
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 152 |
| 3 | Proof_by_QED | 146 |
| 3 | Um_nik | 146 |
| 5 | Dominater069 | 144 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
help pls
| Name |
|---|



Ternary search helps in such scenarios where the function is first increasing and then decreasing or first decreasing and then increasing
at linear functions the array is increase or decrease we use binary search but at quadratic function it decrease then increase or increase then decrease we use tirnary search u could see the visualization of a function at geogebra for example
You don't binary search. Instead, you use ternary search
you can do binary search not on the initial array (for example $$$arr$$$), but on $$$arr_i - arr_{i+1}$$$. Firstly sign of this function will be negative, then positive, so you can use binary search
use binary search and Sparse Table
Check this out https://cp-algorithms.com/num_methods/ternary_search.html
https://oi-wiki.org/basic/binary/#%E4%B8%89%E5%88%86%E6%B3%95 This may help you.